Advertisement
reebypastalina

min browser PKGBUILD

May 19th, 2024
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.34 KB | None | 0 0
  1. pkgname=min
  2. pkgver=1.32.1
  3. _electronver=29
  4. pkgrel=1
  5. pkgdesc='A fast, minimal browser that protects your privacy'
  6. arch=('x86_64')
  7. url='https://minbrowser.org/'
  8. license=('Apache')
  9. depends=("electron${_electronver}" 'libsecret')
  10. makedepends=('git' 'npm')
  11. options=(!emptydirs)
  12. source=(https://github.com/minbrowser/min/archive/v$pkgver/$pkgname-$pkgver.tar.gz
  13.         'min.desktop'
  14.         'min.js'
  15.         'min.sh'
  16.         'icon.patch')
  17. sha256sums=('760fb5d4d10a8d5a44dad6f0e7b3ee58576f46fba5098df39a3fff8576c0086f'
  18.             'a069caac07638ca2bafde5f96a4db646ec7484741ff9b44788c2e159b5142650'
  19.             'de76a609bdbedba2d3c59f4ff2ff05c74211876fa7c52db461f9475b63a682a1'
  20.             'b6909f49c61dfe3ef2610ef966e43ab3b0b423422d17e753706b8e92e0da2b2b'
  21.             '3cff8e5613907c3776115ccdb14f37a4899c96874f662281a630912d893c1d87')
  22.  
  23. prepare() {
  24.     cd $pkgname-$pkgver
  25.  
  26.     patch -Np1 -i "${srcdir}"/icon.patch
  27. }
  28.  
  29. build() {
  30.     cd $pkgname-$pkgver
  31.  
  32.     npm install
  33.     npm run build
  34.     rm -r node_modules
  35.     cat /dev/null > scripts/setupDevEnv.js
  36.     npm install --omit=dev --omit=optional
  37. }
  38.  
  39. package() {
  40.     cd $pkgname-$pkgver
  41.  
  42.     appdir=/usr/lib/${pkgname}
  43.  
  44.     install -dm755 "${pkgdir}"${appdir}
  45.     cp -r * "${pkgdir}"${appdir}
  46.  
  47.     install -dm755 "${pkgdir}"/usr/share/icons/hicolor/256x256/apps
  48.     mv icons/icon256.png \
  49.         "${pkgdir}"/usr/share/icons/hicolor/256x256/apps/${pkgname}.png
  50.  
  51.     install -d "${pkgdir}/usr/bin"
  52.     sed -i -e "s|@ELECTRON@|electron${_electronver=19}|" "${srcdir}/${pkgname}.js"
  53.     install -m755 "${srcdir}/${pkgname}.js" "${pkgdir}/${appdir}/${pkgname}.js"
  54.     install -m755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
  55.  
  56.     install -Dm644 "${srcdir}"/${pkgname}.desktop \
  57.             "${pkgdir}"/usr/share/applications/${pkgname}.desktop
  58.  
  59.     # Clean up
  60.     rm "${pkgdir}"${appdir}/dist/build.js
  61.     rm -r "${pkgdir}"${appdir}/icons
  62.     rm -r "${pkgdir}"${appdir}/localization
  63.     rm -r "${pkgdir}"${appdir}/main
  64.     rm -r "${pkgdir}"${appdir}/scripts
  65.     find "${pkgdir}"${appdir} \
  66.         -name "package.json" \
  67.             -exec sed -e "s|${srcdir}/${pkgname}|${appdir}|" \
  68.                 -i {} \; \
  69.         -or -name ".*" -prune -exec rm -r '{}' \; \
  70.         -or -name "*.Makefile" -exec rm '{}' \; \
  71.         -or -name "*.h" -exec rm '{}' \; \
  72.         -or -name "*.c" -exec rm '{}' \; \
  73.         -or -name "*.cc" -exec rm '{}' \; \
  74.         -or -name "*.gypi" -exec rm '{}' \; \
  75.         -or -name "*.mk" -exec rm '{}' \; \
  76.         -or -name "Gruntfile.js" -exec rm '{}' \; \
  77.         -or -name "Makefile" -exec rm '{}' \; \
  78.         -or -name "bin" -prune -exec rm -r '{}' \; \
  79.         -or -name "bin.js" -exec rm '{}' \; \
  80.         -or -name "bower.json" -exec rm '{}' \; \
  81.         -or -name "cli.js" -exec rm '{}' \; \
  82.         -or -name "cmd.js" -exec rm '{}' \; \
  83.         -or -name "coffee" -prune -exec rm -r '{}' \; \
  84.         -or -name "example" -prune -exec rm -r '{}' \; \
  85.         -or -name "examples" -prune -exec rm -r '{}' \; \
  86.         -or -name "gulpfile.js" -exec rm '{}' \; \
  87.         -or -name "man" -prune -exec rm -r '{}' \; \
  88.         -or -name "obj.target" -prune -exec rm -r '{}' \; \
  89.         -or -name "scripts" -prune -exec rm -r '{}' \; \
  90.         -or -name "test" -prune -exec rm -r '{}' \; \
  91.         -or -name "tests" -prune -exec rm -r '{}' \;
  92. }
  93.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement