#!/bin/sh # test we are root if [ "$(id -u)" != "0" ]; then exit 1 fi # build order is libfm-extra-dev menu-cache libfm then pcmanfm export CFLAGS="-mtune=generic -Os -pipe" export CXXFLAGS="-mtune=generic -Os -pipe -fno-exceptions -fno-rtti" P=libfm V=1.3.2 SRC=$P-$V USER=`cat /etc/sysconfig/tcuser` LIST="compiletc submitqc menu-cache-dev libexif-dev gtk3-dev intltool " for Z in $LIST do su -c "tce-load -i $Z" $USER done # build 1 wants /etc/ not /usr/local/etc cd /tmp su -c "/usr/local/bin/wget -nc --no-check-certificate \ https://downloads.sourceforge.net/pcmanfm/$SRC.tar.xz " $USER tar xvf $SRC*xz cd $SRC # compile requests etc for configs ./configure --prefix=/usr/local --sysconfdir=/etc --enable-static=no --with-gtk=3 --disable-old-actions # prefix: /usr/local # sysconfdir: /etc # Enable compiler flags and other support for debugging: no # Build udisks support (Linux only, experimental): no # Build with libexif for faster thumbnail loading: yes # Build demo program src/demo/libfm-demo: no # Build with custom actions support (requires Vala): no # Large file support: yes # GIO module for preferred apps (for glib < 2.28 only): not required # Build libfm-gtk for Gtk+ version: 3.0 # Build API doc with gtk-doc (recommended for make dist): no #################################################### find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \; make check # 40 secs make install-strip DESTDIR=/tmp/$P cd /tmp # locale ######### mkdir -p $P-locale/usr/local/share mv $P/usr/local/share/locale $P-locale/usr/local/share # no doc ##### rm -rf $P/usr/local/share/man # dev ##### we will use the libfm-extra.pc from TCE not the libfm-extra-dev for pcmanfm build mkdir -p $P-dev/usr/local/lib mv $P/usr/local/include $P-dev/usr/local/ mv $P/usr/local/lib/pkgconfig $P-dev/usr/local/lib/ rm -rf $P/usr/local/lib/*la # dev tce.installed ################### mkdir -p $P-dev/usr/local/tce.installed cat >> $P-dev/usr/local/tce.installed/$P-dev <<'EOF' #!/bin/sh # Due to libfm-extra duplications removes all libfm* files # Link to libfm and not libfm-extra, libfm is loaded before libfm-dev so some duplication P=libfm INC=/usr/local/include LIB=/usr/local/lib DIR1=$P-dev/usr/local DIR2=/tmp/tcloop/$DIR1/lib/pkgconfig DIR3=/tmp/tcloop/$DIR1/include DIR4=/tmp/tcloop/$P/usr/local/lib rm -rf $INC/$P* rm -rf $LIB/pkgconfig/$P* rm -rf $LIB/$P*so* # The linking is what TC would have done if it was simple TCE ln -s $DIR2/*pc $LIB/pkgconfig/ ln -s $DIR3/$P-1.0 $INC/ ln -s $DIR3/$P-1.0 $INC/$P ln -s $DIR4/$P*so* $LIB/ EOF chown -R root:staff $P-dev/usr/local/tce.installed chmod -R 775 $P-dev/usr/local/tce.installed # main ################################### # remove trash support, its messy otherwise rm -rf $P/usr/local/lib/$P/modules/gtk-menu-trash.so # I need to change libfm.conf to affect MAINLY trash network EXL=$P/etc/xdg/$P/$P.conf rm -rf $EXL echo '# Change in pcmanfm Edit Preferences # Any changes you make will edit ~/.config/libfm/libfm.conf [config] single_click=1 use_trash=0 confirm_del=1 confirm_trash=0 quick_exec=1 thumbnail_local=1 thumbnail_max=2048 [ui] big_icon_size=48 small_icon_size=24 thumbnail_size=128 pane_icon_size=24 show_thumbnail=1 [places] places_home=1 places_desktop=1 places_root=1 places_computer=0 places_trash=0 places_applications=0 places_network=0 places_unmounted=0' > $EXL # fix desktops and lxshortcut ############# APPS=$P/usr/local/share/applications sed 's|X-LXDE-Settings;||' -i $APPS/$P*desktop sed 's|OnlyShowIn=LXDE|NoDisplay=true|' -i $APPS/$P*desktop rm -rf $APPS/lxshortcut.desktop rm -rf $P/usr/local/bin/lxshortcut mkdir -p $P/usr/local/share/doc/$P echo 'GPL v2' > $P/usr/local/share/doc/$P/COPYING # fix read-write modules dir as per error launch pcmanfm error = modules directory is not accessible # it looks like it wants read-write at our modules dir # tce.installed ################ mkdir -p $P/usr/local/tce.installed cat >> $P/usr/local/tce.installed/$P <<'EOF' #!/bin/sh # avoid libfm-extra-dev duplication P=libfm LOOP1=/tmp/tcloop/$P/usr/local/lib rm -rf /usr/local/lib/$P*so* # The linking is what TC would have done if it was simple ln -s $LOOP1/$P*so* /usr/local/lib # make modules Dir that is read-write rm -rf /usr/local/lib/$P/modules mkdir -p /usr/local/lib/$P/modules LOOP2=/tmp/tcloop/$P/usr/local/lib/$P/modules cp $LOOP2/*.so /usr/local/lib/$P/modules EOF chown -R root:staff $P/usr/local/tce.installed chmod -R 775 $P/usr/local/tce.installed # 2025 change desktop icon preferences-desktop mkdir -p $P/usr/local/share/pixmaps mv $P/usr/local/share/libfm/images/folder.png $P/usr/local/share/pixmaps/libfm.png ln -s $P/usr/local/share/pixmaps/libfm.png $P/usr/local/share/libfm/images/folder.png sed 's|preferences-desktop|libfm|' -i $P/usr/local/share/applications/$P-pref-apps.desktop sed 's|true|false|g' -i $P/usr/local/share/applications/$P-pref-apps.desktop # mainly reduced deps by not needing startup-notifications # TCZ them ########### LIST="$P $P-locale $P-dev " for Z in $LIST do mksquashfs $Z $Z.tcz md5sum $Z.tcz > $Z.tcz.md5.txt cd $Z find . -not -type d | cut -c 2- | sort > /tmp/$Z.tcz.list cd /tmp done ls -hal echo 'Title: libfm-dev.tcz Description: devs for libfm Version: 1.3.2 Author: https://github.com/lxde/libfm/blob/master/AUTHORS Original-site: https://downloads.sourceforge.net/pcmanfm Copying-policy: GPL v 2 Size: 84K Extension_by: aus9 @linuxquestions.org Tags: pcmanfm Comments: Dev files install script will delete if found, libfm-extra-dev files Change-log: 2014/01/18 First version, 1.1.2.2 (bmarkus) 2015/08/20 v1.2.3 (gordon64) 2019/02/11 v1.2.5 on 10x (aus9) 2020/07/19 v1.3.1 for 11x modify install script 2023/03/26 v 1.3.2 on 14x 2024/04/04 remove la files, change modules dir on 15x Current: 2025/01/02 rebuilt on gtk3 ' > $P-dev.tcz.info echo 'libfm.tcz menu-cache-dev.tcz gtk3-dev.tcz libexif-dev.tcz' > $P-dev.tcz.dep echo 'Title: libfm-locale.tcz Description: locales for libfm Version: 1.3.2 Author: https://github.com/lxde/libfm/blob/master/AUTHORS Original-site: https://downloads.sourceforge.net/pcmanfm Copying-policy: GPL v 2 Size: 596K Extension_by: aus9 @linuxquestions.org Tags: locale pcmanfm Comments: not tested Change-log: 2014/01/18 First version, 1.1.2.2 (bmarkus) 2015/08/20 v1.2.3 (gordon64) 2019/02/11 v1.2.5 on 10x (aus9) 2020/07/19 v1.3.1 for 11x modify install script 2023/03/26 v 1.3.2 on 14x 2024/04/04 remove la files, change modules dir on 15x Current: 2025/01/02 rebuilt on gtk3 ' > $P-locale.tcz.info echo 'libfm.tcz ' > $P-locale.tcz.dep echo 'Title: libfm.tcz Description: mainly lib files for pcmanfm, see below Version: 1.3.2 Author: https://github.com/lxde/libfm/blob/master/AUTHORS Original-site: https://downloads.sourceforge.net/pcmanfm Copying-policy: GPL v2 Size: 372K Extension_by: aus9 @linuxquestions.org Tags: pcmanfm Comments: Config will auto-create at ~/.config/libfm/libfm.conf Original /etc/xdg/libfm/libfm.conf gvfs and trash can support disabled. pcmanfm has the setting but do not use trash please. Install script will delete if found any libfm-extra-dev shared object files & makes read-write modules dir Change-log: 2014/01/18 First version, 1.1.2.2 (bmarkus) 2015/08/20 v1.2.3 (gordon64) 2019/02/11 v1.2.5 on 10x (aus9) 2020/07/19 v1.3.1 for 11x modify install script 2023/03/26 v 1.3.2 on 14x 2024/04/04 remove la files, change modules dir on 15x Current: 2025/01/02 rebuilt on gtk3 ' > $P.tcz.info readelf -d $P/usr/local/lib/*.so | grep 'NEEDED' # delete any duplicates ignore TCBs #libgio-2.0.so.0]libgthread-2.0.so.0]libgobject-2.0.so.0]libglib-2.0.so.0] glib2 at-spi2-core gtk3 #libgtk-3.so.0] libgdk-3.so.0 gtk3 #libpangocairo-1.0.so.0]libpango-1.0.so.0]libpangoft2-1.0.so.0] pango gtk3 #libatk-1.0.so.0] atk-spi2-core gtk3 #libgdk_pixbuf-2.0.so.0]gdk-pixbuf2 gtk3 #libfontconfig.so.1] fontconfig cairo pango gtk3 #libfreetype.so.6] freetype fontconfig cairo pango gtk3 #libharfbuzz.so.0] harfbuzz freetype fontconfig cairo pango gtk3 #libcairo.so.2] cairo pango gtk3 #libmenu-cache.so.3] menu-cache #libfm.so.4] this tce #libexif.so.12] libexif readelf -d $P/usr/local/bin/* | grep 'NEEDED' # libfm-gtk3.so.4] this TCE # does not exist for gtk3 NEXT LINEs # readelf -d $P/usr/local/lib/libfm/modules/*.so | grep 'NEEDED' # no extra to above # submitqc might use ldd as it reports a missing dep but thinks its needed ldd $P/usr/local/bin/libfm-pref-apps | grep libXdamage # libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x00007ff17ef07000) # RECHECK readelf -d $P/usr/local/bin/* | grep 'NEEDED' | grep libXdamage # false positive so ignore # icon theme removed now echo 'gtk3.tcz menu-cache.tcz libexif.tcz ' > $P.tcz.dep # submitqc also getting confused with libfm-extra-dev submitqc --libs --no-fix rm -rf *.zsync