# Description: The next-generation molecular visualization program # URL: https://www.cgl.ucsf.edu/chimerax/download.html # Maintainer: Petar Petrov, slackalaxy at gmail dot com # Depends on: gnutls gtk3 lame libidn2 openmm openssl11 patchelf postgresql pulseaudio qt6-3d qt6-multimedia qt6-quick3d qt6-svg qt6-wayland qt6-webview tslib unixodbc xorg-libxinerama xorg-libxkbfile name=chimerax version=1.7.1 release=1 source=(https://www.cgl.ucsf.edu/chimerax/cgi-bin/secure/chimerax-get.py?file=1.6/linux/ChimeraX-$version.tar.gz https://sourceware.org/pub/libffi/libffi-3.2.tar.gz $name.desktop) renames=(ChimeraX-$version.tar.gz SKIP SKIP) build() { cd $name-$version mkdir -p $PKG/usr/share cp -a share/man $PKG/usr/share rm -rf share/{doc,docs,man} mkdir -p $PKG/usr/lib/$name cp -a * $PKG/usr/lib/$name mkdir -p $PKG/usr/bin cd $PKG/usr/bin ln -s ../lib/$name/bin/ChimeraX chimerax mkdir -p $PKG/usr/share/{applications,pixmaps} cp -a $PKG/usr/lib/$name/share/ChimeraX-icon64.png $PKG/usr/share/pixmaps/chimerax cp -a $SRC/chimerax.desktop $PKG/usr/share/applications # I don't need the cuda stuff (no hardware), but let's leave the # plugins folder for future releases. rm -rf $PKG/usr/lib/chimerax/lib/plugins/libOpenMM* # use ncurses instead cd $PKG/usr/lib/$name/lib patchelf --replace-needed "libtinfo.so.6" "libncurses.so.6" \ $PKG/usr/lib/chimerax/lib/python3.11/lib-dynload/_curses.cpython-311-x86_64-linux-gnu.so patchelf --replace-needed "libtinfo.so.6" "libncurses.so.6" \ $PKG/usr/lib/chimerax/lib/python3.11/lib-dynload/_curses_panel.cpython-311-x86_64-linux-gnu.so #ln -s /usr/lib/libncurses.so . # use this from mariadb ln -s /usr/lib/libmysqlclient.so libmysqlclient.so.21 # other plugins rm -rf $PKG/usr/lib/chimerax/lib/python3.9/site-packages/PyQt6/Qt6/plugins/texttospeech # I am not introducing a new dependency, because of this... cd $SRC/libffi-3.2 sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' -i include/Makefile.in sed \ -e '/^includedir/ s/=.*$/=@includedir@/' \ -e 's/^Cflags: -I${includedir}/Cflags:/' \ -i libffi.pc.in ./configure --prefix=/usr/lib/$name make cp -a x86_64-unknown-linux-gnu/.libs/libffi.so* $PKG/usr/lib/$name/lib # leave the us locales # https://www.cyberciti.biz/faq/linux-bash-delete-all-files-in-directory-except-few/ find $PKG/usr/lib/chimerax/lib/python3.11/site-packages/PyQt6/Qt6/translations/ -type f -not \( -name "en-US.pak" -or -name "*_en.qm" \) -delete find $PKG/usr/lib/chimerax/lib/python3.11/site-packages/babel/locale-data/ -type f -not \( -name "en_US.dat" -or -name "en_US_POSIX.dat" \) -delete rm -rf $PKG/usr/lib/chimerax/lib/python3.11/site-packages/sphinx/locale rm -rf $PKG/usr/lib/chimerax/lib/python3.11/site-packages/sphinxcontrib/applehelp/locales rm -rf $PKG/usr/lib/chimerax/lib/python3.11/site-packages/sphinxcontrib/devhelp/locales rm -rf $PKG/usr/lib/chimerax/lib/python3.11/site-packages/sphinxcontrib/htmlhelp/locales rm -rf $PKG/usr/lib/chimerax/lib/python3.11/site-packages/sphinxcontrib/qthelp/locales rm -rf $PKG/usr/lib/chimerax/lib/python3.11/site-packages/sphinxcontrib/serializinghtml/locales # cleanup find $PKG/ -name "*README*" -delete find $PKG/ -name "*INSTALL*" -delete find $PKG/ -name "*ChangeLog*" -delete find $PKG/ -name "*TODO*" -delete find $PKG/ -name "*NEWS*" -delete find $PKG/ -name "*AUTHORS*" -delete find $PKG/ -name "*COPYING*" -delete find $PKG/ -name "*LICENSE*" -delete mkdir -p $PKG/etc/revdep.d # https://stackoverflow.com/questions/539583/how-do-i-recursively-list-all-directories-at-a-location-breadth-first find $PKG/usr/lib/$name/lib -type d | perl -lne 'print tr:/::, " $_"' | sort -n | cut -d' ' -f2 > $PKG/etc/revdep.d/$name sed -i "s:$PKG::g" $PKG/etc/revdep.d/$name }