diff options
author | Kyle Manna | 2020-04-12 10:58:47 -0700 |
---|---|---|
committer | Kyle Manna | 2020-04-12 10:58:47 -0700 |
commit | 2143ab24734e5f91c7bb665d7ca6b4258336c44e (patch) | |
tree | e2cf66eaec0fc5b6e52a9e8fceb526b77a7db971 /PKGBUILD | |
parent | 4c3c92bc9bb873f15199088ac3fa21df02e6ba49 (diff) | |
download | aur-2143ab24734e5f91c7bb665d7ca6b4258336c44e.tar.gz |
release: v2.3.2
* Follow upstream.
* This is painful
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 144 |
1 files changed, 106 insertions, 38 deletions
@@ -1,29 +1,111 @@ # Maintainer: Kyle Manna <kyle(at)kylemanna(dot)com> pkgname=wavedrom-editor -pkgver=1.6.3 +pkgver=2.3.2 pkgrel=1 pkgdesc="Timing diagram rendering engine" arch=('x86_64') url="http://wavedrom.com" license=('MIT') +depends=('nodejs' 'npm') # For some reason, stripping the nwjs binary breaks the app options=('!strip') -sha256sums_x86_64=('SKIP' - '1aef8354a3bf9714aab32595f27b142034332cb4e3a7381d3fd133a2937fd579' +sha256sums_x86_64=('c2810ade76dc59c167d34791820cab0c62d12f633e077c41025b694269c3a5e5' 'c8cf2a7f6626452bb10eef4f8b4b02bf1992e360e93857a90b2ed7212044f1e2') -source_x86_64=("${pkgname}-${pkgver}::git+https://github.com/wavedrom/wavedrom.github.io.git#tag=v${pkgver}" - "http://dl.nwjs.io/v0.27.3/nwjs-v0.27.3-linux-x64.tar.gz" +source_x86_64=("https://github.com/wavedrom/wavedrom.github.io/archive/v${pkgver}.tar.gz" "wavedrom-editor.desktop" ) -build() { - cd "${srcdir}/${pkgname}-${pkgver}" +_srcdir_name=wavedrom.github.io-${pkgver} + +# Re-implement the downlaoded build.sh script while dropping support for other platforms +# Upstream: https://raw.githubusercontent.com/drom/simple-nwjs-app/master/build.sh +build_sh() { + local NWVERSION="v0.44.4" + local V="v1.0.0" + local N="simpleapp" + local PREFIX="" + local P="linux-x64" + + # command line arguments + while [[ $# -gt 1 ]] + do + key="$1" + + case $key in + -n|--name) + N="$2" + shift + ;; + -p|--prefix) + PREFIX="$2" + shift + ;; + -w|--nwversion) + NWVERSION="$2" + shift + ;; + -v|--version) + V="$2" + shift + ;; + *) + ;; + esac + shift + done + + URL="http://dl.nwjs.io/"$NWVERSION + NWV=$PREFIX$NWVERSION + + urlget() { + if ! [ -f "$2" ]; then + if hash wget 2>/dev/null; then + wget "$1" -O "$2" + elif hash curl 2>/dev/null; then + curl "$1" -o "$2" + else + echo "wget or curl must be installed." + exit 1 + fi + fi + } + + mkdir -p build + + rm -rf build/* + + # make app + pushd src && zip -r ../build/"$N"-$V.nw * && popd + + mkdir -p cache + rm -rf cache/*/* + + # get and unpack NWJS packages + urlget $URL/nwjs-$NWV-$P.tar.gz cache/nwjs-$NWV-$P.tar.gz + tar -xvf cache/nwjs-$NWV-$P.tar.gz -C cache + + # clean cache + mkdir -p cache/"$N"-$V-$P + rm -rf cache/"$N"-$V-$P/* + cp -R cache/nwjs-$NWV-$P/* cache/"$N"-$V-$P + + # pack APP packages + cat cache/"$N"-$V-$P/nw build/"$N"-$V.nw > cache/"$N"-$V-$P/"$N" + chmod +x cache/"$N"-$V-$P/"$N" + rm cache/"$N"-$V-$P/nw + pushd cache && tar -cvzf ../build/"$N"-$V-$P.tar.gz "$N"-$V-$P/* && popd +} +build_wde_sh() { # Implement build-wde.sh + cp node_modules/wavedrom/wavedrom.min.js WaveDrom.js + cp node_modules/wavedrom/wavedrom.min.js wavedrom.min.js + cp node_modules/wavedrom/skins/*.js skins + mkdir src rm -rf src/* @@ -37,45 +119,31 @@ build() { cp editor.html src/ cp tutorial.html src/ cp WaveDromEditor/package.json src/ - cp wavedrom.min.js src/ + cp node_modules/wavedrom/wavedrom.min.js src/ cp images/ic_*.png src/images/ cp images/favicon.ico src/images cp images/logo.png src/images - cp skins/* src/skins + cp node_modules/wavedrom/skins/* src/skins cp css/* src/css cp scripts/* src/scripts - #wget https://raw.githubusercontent.com/drom/simple-nwjs-app/master/build.sh -O build.sh - #bash build.sh --name wavedrom-editor --version v1.6.2 - - # Implement build.sh - NWV="v0.27.3" - V="${pkgver}" - N="${pkgname}" - P="linux-x64" - - mkdir -p build - rm -rf build/* - - # make app - pushd src && zip -r ../build/"$N"-$V.nw * && popd + #curl https://raw.githubusercontent.com/drom/simple-nwjs-app/master/build.sh -o build.sh + #bash build.sh --name wavedrom-editor --version v2.3.2 + build_sh --name ${pkgname} --version v${pkgver} +} - mkdir -p cache - rm -rf cache/*/* - - tar -xvf ${srcdir}/nwjs-$NWV-$P.tar.gz -C cache +prepare() { + cd "${srcdir}/${_srcdir_name}" + # This would be nice... npm install --production + npm install +} - # clean cache - mkdir -p cache/"$N"-$V-$P - rm -rf cache/"$N"-$V-$P/* - cp -R cache/nwjs-$NWV-$P/* cache/"$N"-$V-$P +build() { + cd "${srcdir}/${_srcdir_name}" - # pack APP packages - cat cache/"$N"-$V-$P/nw build/"$N"-$V.nw > cache/"$N"-$V-$P/"$N" - chmod +x cache/"$N"-$V-$P/"$N" - rm cache/"$N"-$V-$P/nw - #pushd cache && tar -cvzf ../build/"$N"-$V-$P.tar.gz "$N"-$V-$P/* && popd + # Running `npm run build` as we expect would download and build for osx, windows, ia32 and maybe more. + build_wde_sh } # @@ -86,7 +154,7 @@ build() { package() { # Copy build files mkdir -p ${pkgdir}/opt - cp -a ${srcdir}/${pkgname}-${pkgver}/cache/${pkgname}-${pkgver}-linux-x64 ${pkgdir}/opt/${pkgname} + cp -a ${srcdir}/${_srcdir_name}/cache/${pkgname}-v${pkgver}-linux-x64 ${pkgdir}/opt/${pkgname} # Symlink in to the default PATH mkdir -p ${pkgdir}/usr/bin @@ -95,5 +163,5 @@ package() { # Create desktop icon mkdir -p "${pkgdir}/usr/share/applications" "${pkgdir}/usr/share/pixmaps" install -m644 "${srcdir}/wavedrom-editor.desktop" "$pkgdir/usr/share/applications/wavedrom-editor.desktop" - install -m644 "${srcdir}/${pkgname}-${pkgver}/images/icon_512.png" "$pkgdir/usr/share/pixmaps/wavedrom-editor.png" + install -m644 "${srcdir}/${_srcdir_name}/images/icon_512.png" "$pkgdir/usr/share/pixmaps/wavedrom-editor.png" } |