[med-svn] [Git][med-team/ghmm][master] 3 commits: Attempt to fix the installation for local builds (for instance with `debuild`)

Andreas Tille (@tille) gitlab at salsa.debian.org
Mon Jan 15 14:49:59 GMT 2024



Andreas Tille pushed to branch master at Debian Med / ghmm


Commits:
762f0126 by Andreas Tille at 2024-01-13T15:18:54+01:00
Attempt to fix the installation for local builds (for instance with `debuild`)
  While this makes the problem consistent between building in pbuilder and debuild it
  installs to /usr/local (despite prefix is properly set) and thus breaks the build for both
  --> patch deactivated

- - - - -
2f53d3ee by Andreas Tille at 2024-01-15T15:46:54+01:00
Try hard to get Python3 modules installed into proper dirs

- - - - -
defd83c4 by Andreas Tille at 2024-01-15T15:49:27+01:00
More syntax fixes

- - - - -


6 changed files:

- debian/control
- debian/ghmm.install
- debian/patches/python3_syntax.patch
- debian/patches/series
- + debian/patches/setuptools.patch
- debian/rules


Changes:

=====================================
debian/control
=====================================
@@ -4,6 +4,7 @@ Uploaders: Steffen Moeller <moeller at debian.org>
 Section: science
 Priority: optional
 Build-Depends: debhelper-compat (= 13),
+               dh-sequence-python3,
                d-shlibs,
                python3-dev,
                pkg-config,
@@ -23,6 +24,7 @@ Package: ghmm
 Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
+         ${python3:Depends},
          python3,
          libghmm1
 Description: General Hidden-Markov-Model library - tools


=====================================
debian/ghmm.install
=====================================
@@ -1,3 +1,3 @@
 usr/bin
 usr/share/ghmm/ghmm.dtd*
-usr/lib/python3*/site-packages/*	usr/lib/ghmm
+#usr/lib/python3*


=====================================
debian/patches/python3_syntax.patch
=====================================
@@ -80,3 +80,23 @@ Last-Update: Thu, 11 Jan 2024 17:06:32 +0100
              return self.GetWeight()
          else:
              return self.__dict__[name]
+--- a/ghmmwrapper/ghmm.py
++++ b/ghmmwrapper/ghmm.py
+@@ -1355,7 +1355,7 @@ class HMMOpenFactory(HMMFactory):
+         result = []
+         for i in range(nrModels):
+             cmodel = getModel(i)
+-            if emission_domain is 'd':
++            if emission_domain == 'd':
+                 emission_domain = Alphabet(cmodel.alphabet)
+             if modelType & ghmmwrapper.kLabeledStates:
+                 labelDomain = LabelDomain(cmodel.label_alphabet)
+@@ -2865,7 +2865,7 @@ class DiscreteEmissionHMM(HMM):
+ 
+         if self.hasFlags(kSilentStates):
+             raise NotImplementedError("Sorry, training of models containing silent states not yet supported.")
+-        if R is -1:
++        if R == -1:
+             R = int(math.ceil(.5*math.log(math.sqrt(len(trainingSequences)))))
+             #print R
+         if R <= 1: 


=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ fix_libxml2_config.patch
 python3_build_system.patch
 #lapacke.patch
 python3_syntax.patch
+# setuptools.patch


=====================================
debian/patches/setuptools.patch
=====================================
@@ -0,0 +1,29 @@
+Description: Attempt to fix the installation for local builds (for instance with `debuild`)
+  While this makes the problem consistent between building in pbuilder and debuild it
+  installs to /usr/local (despite prefix is properly set) and thus breaks the build for both
+  --> patch deactivated
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Thu, 11 Jan 2024 17:06:32 +0100
+
+--- a/HMMEd/setup.py
++++ b/HMMEd/setup.py
+@@ -35,7 +35,7 @@
+ #
+ ################################################################################
+ 
+-from distutils.core import setup,Extension
++from setuptools import setup, Extension
+ 
+    
+ setup(name="HMMEd",
+--- a/ghmmwrapper/setup.py
++++ b/ghmmwrapper/setup.py
+@@ -35,7 +35,7 @@
+ #
+ ################################################################################
+ 
+-from distutils.core import setup,Extension
++from setuptools import setup, Extension
+    
+ setup(name="ghmmwrapper",
+       version="0.8",


=====================================
debian/rules
=====================================
@@ -1,17 +1,28 @@
 #!/usr/bin/make -f
-#export DH_VERBOSE = 1
+
+export DH_VERBOSE = 1
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+export PYBUILD_NAME=HMMEd
+
 %:
 	dh $@
 
 override_dh_auto_configure:
-	dh_auto_configure -- --enable-atlas
+	dh_auto_configure --sourcedirectory=$(CURDIR) -- --enable-atlas
+	dh_auto_configure --buildsystem=pybuild --sourcedirectory=HMMEd
+
+override_dh_auto_build:
+	dh_auto_build
+	dh_auto_build --buildsystem=pybuild --sourcedirectory=HMMEd
+
+override_dh_auto_install:
+	dh_auto_install
+	dh_auto_install --buildsystem=pybuild --sourcedirectory=HMMEd
 
 override_dh_install:
 	dh_install
-	find $(CURDIR)/debian/tmp -name "*.pyc" -delete
 	d-shlibmove --commit \
 		    --multiarch \
 		    --devunversioned \
@@ -22,8 +33,18 @@ override_dh_install:
 	cd $(CURDIR)/debian/ghmm/usr/bin/ && mv cluster ghmm-cluster
 	sed -i -e 's@ [^ ]*-f\(file\|debug\)-prefix-map=[^ ]*@@g' \
 		$(CURDIR)/debian/ghmm/usr/bin/ghmm-config
-	find debian -name __pycache__ | xargs rm -rf
 	find debian -name libghmm.la -delete
+	# temporarily copy over ghmmwrapper to the pybuild created dir
+	mkdir -p debian/python3-HMMEd/usr/lib/python3/dist-packages
+	mv debian/tmp/usr/local/lib/python3.11/dist-packages/ghmmwrapper-0.8-py3*.egg debian/python3-HMMEd/usr/lib/python3/dist-packages/ghmm
+	rm -rf debian/tmp/usr/local
+	find debian -type d -name __pycache__ | xargs rm -rf
+
+override_dh_python3:
+	# We do not provide a package python3-HMMEd thus copy the pybuild installed files over to ghmm
+	mv debian/python3-HMMEd/usr/bin/* debian/ghmm/usr/bin
+	mv debian/python3-HMMEd/usr/lib debian/ghmm/usr
+	dh_python3 -p ghmm
 
 override_dh_auto_clean:
 	if [ -r Makefile ]; then $(MAKE) clean; fi
@@ -42,4 +63,3 @@ override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	$(MAKE) --directory=tests
 endif
-



View it on GitLab: https://salsa.debian.org/med-team/ghmm/-/compare/34de713884e6588f9ad4696d3f3a61f04943f99a...defd83c42c30fab4d4ed456455d196bef5665c7d

-- 
View it on GitLab: https://salsa.debian.org/med-team/ghmm/-/compare/34de713884e6588f9ad4696d3f3a61f04943f99a...defd83c42c30fab4d4ed456455d196bef5665c7d
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240115/4a674b23/attachment-0001.htm>


More information about the debian-med-commit mailing list