Breaking Boxes Open on Shabbos – Eruvin 34b
תלמוד בבלי מסכת עירובין דף לד/ב
משנה נתנו במגדל ואבד המפתח הרי זה עירוב
The Gemara here makes it clear that if the eruv was left in a locked, wooden box, that it would not be a valid eruv, since it is inaccessible. It is only if the eruv was left in a box or closet that was made of bricks that were not cemented together — in which case the bricks could be removed on Shabbos without violating the prohibition of Soseir (Destroying), that the eruv is valid.
The Beur Halachah (§314 d.h. Assur) notes that it would seem that this Gemara contradicts the well known Rashi (Shabbos 146a) that destructive activity (viz., breaking a jug) on Shabbos is not prohibited at all. Even the Rishonim who find this assertion difficult (as it seems from several sugyos that there is a rabbinic prohibition even on destructive activities) write that breaking for the purpose of Shabbos is permitted.
Shemiras Shabbos K'Hilchasah (Chap. 15, Note 249) writes in the name of Rabbi Shlomo Zalman Auerbach that it is indeed possible that not all destructive activity is permitted on Shabbos. Rather, when a container was not a proper vessel while it contained an object (i.e., it was not usable for another purpose), and will not be a proper vessel after it is broken to have the object inside removed; there is no prohibition to break it on Shabbos. Hence, rules Shemiras Shabbos (15:80), if clothing was sealed in plastic, and one forgot to open the bag before Shabbos, one may open the bag on Shabbos in a manner that renders it unsuitable for another purpose.