commit:     7911079d4e3a5d8f1c18ac258508766ad148a2a7
Author:     Patrick Taylor <patrick.joseph.taylor <AT> gmail <DOT> com>
AuthorDate: Thu Sep  8 19:41:15 2022 +0000
Commit:     Patrick Taylor <patrick.joseph.taylor <AT> gmail <DOT> com>
CommitDate: Thu Sep  8 19:41:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7911079d

sci-chemistry/xcrysden: new package, add 1.6.2

Signed-off-by: Patrick Taylor <patrick.joseph.taylor <AT> gmail.com>

 sci-chemistry/xcrysden/Manifest                    |   1 +
 sci-chemistry/xcrysden/files/icons/xcrysden.png    | Bin 0 -> 11920 bytes
 .../xcrysden/files/xcrysden-1.6.2-Togl_lib.patch   |  14 +++++
 .../files/xcrysden-1.6.2-ext-bwidget.patch         |  14 +++++
 .../xcrysden/files/xcrysden-1.6.2-gcc_flags.patch  |  14 +++++
 .../files/xcrysden-1.6.2-wrapper_paths.patch       |  16 +++++
 sci-chemistry/xcrysden/files/xcrysden.desktop      |   8 +++
 sci-chemistry/xcrysden/xcrysden-1.6.2.ebuild       |  67 +++++++++++++++++++++
 8 files changed, 134 insertions(+)

diff --git a/sci-chemistry/xcrysden/Manifest b/sci-chemistry/xcrysden/Manifest
new file mode 100644
index 000000000..a5d3d6532
--- /dev/null
+++ b/sci-chemistry/xcrysden/Manifest
@@ -0,0 +1 @@
+DIST xcrysden-1.6.2.tar.gz 2460277 BLAKE2B 
f0b7c2c5aeff51db97b29c8052273ed44bb9c183e0df62c406eee327c4c5d86d141d8adfd05df70b97661a8cbddbf052c233c288f1f30b308e4c877539c06a84
 SHA512 
9ed1b7fc11674509a3f2bf6604aa11e087fd77a971afb93039ca542cb9abb62b2553c7f386b845f004df5d3d340bdf1fe673552319788f006fd031efb6a4ad67

diff --git a/sci-chemistry/xcrysden/files/icons/xcrysden.png 
b/sci-chemistry/xcrysden/files/icons/xcrysden.png
new file mode 100644
index 000000000..f41eddceb
Binary files /dev/null and b/sci-chemistry/xcrysden/files/icons/xcrysden.png 
differ

diff --git a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-Togl_lib.patch 
b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-Togl_lib.patch
new file mode 100644
index 000000000..533c50650
--- /dev/null
+++ b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-Togl_lib.patch
@@ -0,0 +1,14 @@
+Ensures that Togl is linked properly.
+diff --git a/system/Make.sys-shared b/system/Make.sys-shared
+index 51891e7..ba478fa 100644
+--- a/system/Make.sys-shared
++++ b/system/Make.sys-shared
+@@ -48,7 +48,7 @@ X_INCDIR  =
+ 
+ TCL_LIB      = -ltcl$(TCL_VER2)
+ TK_LIB       = -ltk$(TCL_VER2)
+-TOGL_LIB     = -lTogl
++TOGL_LIB     = -Wl,-rpath,"/usr/lib64/Togl2.0" -L/usr/lib64/Togl2.0 -lTogl2.0
+ GLU_LIB      = -lGLU
+ GL_LIB       = -lGL
+ FFTW3_LIB    = -lfftw3

diff --git a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-ext-bwidget.patch 
b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-ext-bwidget.patch
new file mode 100644
index 000000000..0ca1f69b6
--- /dev/null
+++ b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-ext-bwidget.patch
@@ -0,0 +1,14 @@
+Prevents bwidget from being automatically downloaded when it is already 
required as a build/run-time dependency.
+diff --git a/Makefile b/Makefile
+index cfdc14a..d0f7e6c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -18,7 +18,7 @@ what:
+ 
+ all: tcl tk mesa togl fftw xcrysden
+ #  meschach 
+-xcrysden: usage bwidget bindir src-C src-F src-Tcl
++xcrysden: usage bindir src-C src-F src-Tcl
+ 
+ usage: $(TOPDIR)/docs/xcrysden.1
+       man $(TOPDIR)/docs/xcrysden.1 | awk 'BEGIN {lprint=0; print "## do not 
edit changes will be lost (file automatically generated)\n"; } /SYNOPSIS/ { 
lprint=1; } /SEE ALSO/ { lprint=0; } /a*/ { if (lprint) print; }' > usage

diff --git a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-gcc_flags.patch 
b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-gcc_flags.patch
new file mode 100644
index 000000000..ef231827e
--- /dev/null
+++ b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-gcc_flags.patch
@@ -0,0 +1,14 @@
+Adds -fcommon to CFLAGS to allow compilation on more recent GCC.
+diff --git a/system/Make.sys-shared b/system/Make.sys-shared
+index 51891e7..f89f876 100644
+--- a/system/Make.sys-shared
++++ b/system/Make.sys-shared
+@@ -19,7 +19,7 @@ MAKE = make
+ # C-preprocessor flags
+ CPPFLAGS ?=
+ # C-compiler flags
+-CFLAGS += -ffast-math -funroll-loops -fPIC -pedantic -Wall
++CFLAGS += -ffast-math -funroll-loops -fPIC -pedantic -Wall -fcommon
+ 
+ CC     = gcc 
+ #LDLIB  = -ldl

diff --git a/sci-chemistry/xcrysden/files/xcrysden-1.6.2-wrapper_paths.patch 
b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-wrapper_paths.patch
new file mode 100644
index 000000000..8cc8b247a
--- /dev/null
+++ b/sci-chemistry/xcrysden/files/xcrysden-1.6.2-wrapper_paths.patch
@@ -0,0 +1,16 @@
+Ensures that wrapper scripts account for live filesystem merge.
+diff --git a/sys_utils/wrappers.sh b/sys_utils/wrappers.sh
+index 1fa3cc6..e078b22 100755
+--- a/sys_utils/wrappers.sh
++++ b/sys_utils/wrappers.sh
+@@ -5,8 +5,8 @@ do
+ #!/bin/sh -f
+ 
+ # simple wrapper to run $cmd
+-XCRYSDEN_TOPDIR="$prefix/share/$xcrysden"
+-XCRYSDEN_LIB_BINDIR="$prefix/lib/$xcrysden"
++XCRYSDEN_TOPDIR="/usr/share/$xcrysden"
++XCRYSDEN_LIB_BINDIR="/usr/lib/$xcrysden"
+ export XCRYSDEN_TOPDIR
+ export XCRYSDEN_LIB_BINDIR
+ 

diff --git a/sci-chemistry/xcrysden/files/xcrysden.desktop 
b/sci-chemistry/xcrysden/files/xcrysden.desktop
new file mode 100644
index 000000000..1f0128280
--- /dev/null
+++ b/sci-chemistry/xcrysden/files/xcrysden.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=XCrySDen
+Type=Application
+Comment=For the visualisation of molecular and crystal structures.
+Exec=xcrysden
+TryExec=xcrysden
+Icon=/usr/share/icons/hicolor/96x96/apps/xcrysden.png
+Categories=Science;

diff --git a/sci-chemistry/xcrysden/xcrysden-1.6.2.ebuild 
b/sci-chemistry/xcrysden/xcrysden-1.6.2.ebuild
new file mode 100644
index 000000000..4d9e97a87
--- /dev/null
+++ b/sci-chemistry/xcrysden/xcrysden-1.6.2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop
+inherit xdg-utils
+
+DESCRIPTION="For the visualisation of molecular and crystal structures."
+
+HOMEPAGE="http://www.xcrysden.org/";
+
+SRC_URI="http://www.xcrysden.org/download/${P}.tar.gz";
+
+LICENSE="GPL-2+"
+
+SLOT="0"
+
+KEYWORDS="~amd64"
+
+RDEPEND=">=dev-lang/tcl-8.6.12
+       >=dev-lang/tk-8.6.12
+       >=dev-tcltk/togl-2.0-r3
+       >=dev-tcltk/bwidget-1.9.14
+       >=media-libs/mesa-22.1.3
+       >=sci-libs/fftw-3.3.10"
+
+BDEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${P}-ext-bwidget.patch"
+       "${FILESDIR}/${P}-gcc_flags.patch"
+       "${FILESDIR}/${P}-Togl_lib.patch"
+       "${FILESDIR}/${P}-wrapper_paths.patch"
+)
+
+src_prepare() {
+       default
+       cp "${S}/system/Make.sys-shared" "${S}/Make.sys" || die 'Copying 
Make.sys to build dir failed.'
+}
+
+src_compile() {
+       emake xcrysden
+}
+
+src_install() {
+       emake \
+               prefix="${D}"/usr \
+               install
+
+       domenu "${FILESDIR}/${PN}.desktop"
+       doicon -s 32x32 "${FILESDIR}/icons/${PN}.png"
+       docompress -x /usr/share/doc/${P}/examples/GAUSSIAN_files/ \
+               /usr/share/doc/${P}/examples/Orca_files/ \
+               /usr/share/doc/${P}/examples/XSF_Files/ \
+               /usr/share/doc/${P}/examples/Scripting/ \
+               /usr/share/doc/${P}/examples/FermiSurface \
+               /usr/share/man/
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_icon_cache_update
+}

Reply via email to