diff options
author | Christopher Arndt | 2019-01-29 00:53:36 +0100 |
---|---|---|
committer | Christopher Arndt | 2019-01-29 00:53:36 +0100 |
commit | 7ba22e74fcb5702125565f33d801b49044b9a115 (patch) | |
tree | 89090bc895759001576e3b014c693e4d8eccbd8d | |
parent | 774f21b50764418e0ea013e16ed44f8752dc39b7 (diff) | |
download | aur-7ba22e74fcb5702125565f33d801b49044b9a115.tar.gz |
Adopted package; add patch to fix error running software on Linux; fixed PKGBUILD to allow both Python 3 and 2 version to be installed at the same time
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | PKGBUILD | 65 | ||||
-rw-r--r-- | airnef-linux.patch | 60 |
4 files changed, 111 insertions, 25 deletions
@@ -1,7 +1,7 @@ pkgbase = python-airnef pkgdesc = Wireless download from your Nikon/Sony/Canon camera pkgver = 1.1 - pkgrel = 1 + pkgrel = 2 url = http://www.testcams.com/airnef/ arch = any license = GPL3 @@ -9,7 +9,9 @@ pkgbase = python-airnef makedepends = python2-setuptools depends = tk source = http://www.testcams.com/airnef/Version_1.1/airnef_v1.1_Source.zip + source = airnef-linux.patch sha512sums = b45b0591e42179d1e5b5eea9ede6762d311cd0642585c54568c90111424e2ca316aa444d772b4855afe42f25b6cc4b3e1b78bb5a0c2a4cb52440535894a5cba6 + sha512sums = c0337540e1e65cee3d6f4bc3610b6d2d2a72b7f97a0197f5dd27768a5f42f1e4e5e936ce059ff4daf9aa95faa5613228306d6d3f4f2f7ed42c5566521138c24d pkgname = python-airnef pkgdesc = Wireless download from your Nikon/Sony/Canon camera (for Python 3.x) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..eefbf756e48e --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +pkg +src +airnef_*.zip +python-airnef-*.pkg.tar.xz +python2-airnef-*.pkg.tar.xz +python-airnef-*.src.tar.gz +.AURINFO @@ -1,40 +1,57 @@ -# PLEASE NOTICE, IT DOES NOT WORK AT THE MOMENT, patches sent to upstream, waiting for a new version: -# http://testcams.com/blog/forums/topic/linux-fix/ +# Maintainer: Christopher Arndt <aur -at- chrisarndt -dot- de> _name=airnef -pkgbase=python-airnef -pkgname=("python-airnef" "python2-airnef") +pkgbase="python-${_name}" +pkgname=("python-${_name}" "python2-${_name}") pkgver=1.1 -pkgrel=1 +pkgrel=2 pkgdesc="Wireless download from your Nikon/Sony/Canon camera" arch=('any') url="http://www.testcams.com/airnef/" license=('GPL3') depends=('tk') makedepends=('python-setuptools' 'python2-setuptools') -source=("http://www.testcams.com/airnef/Version_1.1/airnef_v1.1_Source.zip") -sha512sums=('b45b0591e42179d1e5b5eea9ede6762d311cd0642585c54568c90111424e2ca316aa444d772b4855afe42f25b6cc4b3e1b78bb5a0c2a4cb52440535894a5cba6') +source=("http://www.testcams.com/airnef/Version_1.1/airnef_v1.1_Source.zip" + "airnef-linux.patch") +sha512sums=('b45b0591e42179d1e5b5eea9ede6762d311cd0642585c54568c90111424e2ca316aa444d772b4855afe42f25b6cc4b3e1b78bb5a0c2a4cb52440535894a5cba6' + 'c0337540e1e65cee3d6f4bc3610b6d2d2a72b7f97a0197f5dd27768a5f42f1e4e5e936ce059ff4daf9aa95faa5613228306d6d3f4f2f7ed42c5566521138c24d') +DLAGENTS=('http::/usr/bin/curl -A "Mozilla/4.0" -fLC - --retry 3 --retry-delay 3 -o %o %u') + + +prepare() { + cd "${srcdir}/${_name}" + + patch -N -p1 -i "${srcdir}"/airnef-linux.patch +} package_python-airnef() { - pkgdesc+=" (for Python 3.x)" - PYTHONVER=`python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'` - install -d ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/appresource - install ${srcdir}/$_name/*.py ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/ - install ${srcdir}/$_name/*.pyw ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/ - install ${srcdir}/$_name/appresource/* ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/appresource/ - install -d ${pkgdir}/usr/bin - ln -s /usr/lib/python$PYTHONVER/site-packages/$_name/airnef.pyw ${pkgdir}/usr/bin/airnef - ln -s /usr/lib/python$PYTHONVER/site-packages/$_name/airnefcmd.py ${pkgdir}/usr/bin/airnefcmd + pkgdesc+=" (for Python 3.x)" + cd "${srcdir}/${_name}" + + local py_ver=$(python -c 'import sys; print("%i.%i" % sys.version_info[:2])') + local package_dir="${pkgdir}/usr/lib/python${py_ver}/site-packages/$_name" + install -dm755 "${package_dir}"/appresource + install *.py "${package_dir}" + install airnef.pyw "${package_dir}"/airnef.py + install appresource/* "${package_dir}"/appresource/ + install -dm755 "${pkgdir}"/usr/bin + ln -s "${package_dir}"/airnef.py "${pkgdir}"/usr/bin/airnef + ln -s "${package_dir}"/airnefcmd.py "${pkgdir}"/usr/bin/airnefcmd } package_python2-airnef() { pkgdesc+=" (for Python 2.x)" - PYTHONVER=`python2 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'` - install -d ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/appresource - install ${srcdir}/$_name/*.py ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/ - install ${srcdir}/$_name/*.pyw ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/ - install ${srcdir}/$_name/appresource/* ${pkgdir}/usr/lib/python$PYTHONVER/site-packages/$_name/appresource/ - install -d ${pkgdir}/usr/bin - ln -s /usr/lib/python$PYTHONVER/site-packages/$_name/airnef.pyw ${pkgdir}/usr/bin/airnef - ln -s /usr/lib/python$PYTHONVER/site-packages/$_name/airnefcmd.py ${pkgdir}/usr/bin/airnefcmd + + cd "${srcdir}/${_name}" + local py_ver=$(python2 -c 'import sys; print "%i.%i" % sys.version_info[:2]') + local package_dir="${pkgdir}/usr/lib/python${py_ver}/site-packages/$_name" + install -dm755 "${package_dir}"/appresource + install *.py "${package_dir}" + install airnef.pyw "${package_dir}"/airnef.py + install appresource/* "${package_dir}"/appresource/ + install -dm755 "${pkgdir}"/usr/bin + sed -i 's|env python$|env python2|' "${package_dir}"/airnef.py + sed -i 's|env python$|env python2|' "${package_dir}"/airnefcmd.py + ln -s "${package_dir}"/airnef.py "${pkgdir}"/usr/bin/airnef2 + ln -s "${package_dir}"/airnefcmd.py "${pkgdir}"/usr/bin/airnefcmd2 } diff --git a/airnef-linux.patch b/airnef-linux.patch new file mode 100644 index 000000000000..9321b9fe8d59 --- /dev/null +++ b/airnef-linux.patch @@ -0,0 +1,60 @@ +diff -uNrb airnef/airnefcmd.py airnef.new/airnefcmd.py +--- airnef/airnefcmd.py 2015-10-07 13:49:44.000000000 +0200 ++++ airnef.new/airnefcmd.py 2019-01-28 22:43:14.207678865 +0100 +@@ -134,6 +134,7 @@ + + self.isWin32 = None # True if we're running on a Windows platform + self.isOSX = None # True if we're runnong on an OSX platform ++ self.isLinux = None # True if we're runnong on an Linux platform + self.isFrozen = None # True if we're running in a pyintaller frozen environment (ie, built as an executable) + self.args = None # dictionary of command-line arguments (generated by argparse) + self.appDir = None # directory where script is located. this path is used to store all metadata files, in case script is run in different working directory +@@ -431,6 +432,7 @@ + + g.isWin32 = (platform.system() == 'Windows') + g.isOSX = (platform.system() == 'Darwin') ++ g.isLinux = (platform.system() == 'Linux') + g.isFrozen = (getattr(sys, 'frozen', False)) # note for OSX isFrozen is always false because py2app only marks airnef.pyw as frozen when we're a py2app + + # +@@ -454,6 +456,10 @@ + applicationSupportDir = os.path.join(userHomeDir, 'Library/Application Support') + if os.path.exists(applicationSupportDir): # probably not necessary to check existence since every system should have this directory + g.appDataDir = os.path.join(applicationSupportDir, 'airnef/appdata') ++ elif g.isLinux: # for OSX we always try to store our app data under Application Support ++ userHomeDir = os.getenv('HOME') ++ if userHomeDir: ++ g.appDataDir = os.path.join(userHomeDir, '.local/share/airnef') + if not g.appDataDir: + # none of runtime-specific cases above selected an app data directory - use directory based off our app directory + g.appDataDir = os.path.join(g.appDir, "appdata") +diff -uNrb airnef/airnef.pyw airnef.new/airnef.pyw +--- airnef/airnef.pyw 2015-10-08 09:57:00.000000000 +0200 ++++ airnef.new/airnef.pyw 2019-01-28 22:43:14.211012198 +0100 +@@ -104,6 +104,7 @@ + def __init__(self): + self.isWin32 = None # True if we're running on a Windows platform + self.isOSX = None # True if we're runnong on an OSX platform ++ self.isLinux = None # True if we're runnong on an Linux platform + self.isFrozen = None # True if we're running in a pyintaller frozen environment (ie, built as an executable) + self.appDir = None # directory where script is located. this path is used to store all metadata files, in case script is run in different working directory + self.appDataDir = None # directory where we keep app metadata +@@ -1202,6 +1203,7 @@ + + g.isWin32 = (platform.system() == 'Windows') + g.isOSX = (platform.system() == 'Darwin') ++ g.isLinux = (platform.system() == 'Linux') + g.isFrozen = (getattr(sys, 'frozen', False)) + + # +@@ -1226,6 +1228,10 @@ + applicationSupportDir = os.path.join(userHomeDir, 'Library/Application Support') + if os.path.exists(applicationSupportDir): # probably not necessary to check existence since every system should have this directory + g.appDataDir = os.path.join(applicationSupportDir, 'airnef/appdata') ++ elif g.isLinux: # for Linux we use .local/share for that ++ userHomeDir = os.getenv('HOME') ++ if userHomeDir: ++ g.appDataDir = os.path.join(userHomeDir, '.local/share/airnef') + if not g.appDataDir: + # none of runtime-specific cases above selected an app data directory - use directory based off our app directory + g.appDataDir = os.path.join(g.appDir, "appdata") |