Skip to content

Commit

Permalink
adding msys2 package build files
Browse files Browse the repository at this point in the history
  • Loading branch information
mittelmark committed Sep 11, 2024
1 parent f183f0c commit 515f2ac
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 6 deletions.
13 changes: 7 additions & 6 deletions microemacs/packages/msys2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Author : $Author$
# Created By : Detlef Groth
# Created : Wed Sep 11 08:13:58 2024
# Last Modified : <240911.1001>
# Last Modified : <240911.1356>
#
# Description
#
Expand All @@ -33,9 +33,10 @@
version=20240902

default:
if [ ! -f Jasspa_MicroEmacs_$(version)_abin_windows_mecs.zip ]; then wget https://github.com/bjasspa/jasspa/releases/download/me_20240902/Jasspa_MicroEmacs_$(version)_abin_windows_mecs.zip ; fi
unzip Jasspa_MicroEmacs_$(version)_abin_windows_mecs.zip -d microemacs-package
cp microemacs-package/bin/*/mecs.exe microemacs-package
cd microemacs-package && rm *.zst
cd microemacs-package && makepkg -si
if [ ! -f Jasspa_MicroEmacs_$(version)_bin_windows_binaries.zip ]; then wget https://github.com/bjasspa/jasspa/releases/download/me_20240902/Jasspa_MicroEmacs_$(version)_abin_windows_mecs.zip ; fi
unzip Jasspa_MicroEmacs_$(version)_bin_windows_binaries.zip -d microemacs-package
cp microemacs-package/bin/*/mec.exe microemacs-package
cp microemacs-package/bin/*/mew.exe microemacs-package
sha5sum microemacs-package/mec.exe microemacs-package && rm *.zst
#cd microemacs-package && makepkg -si
#pacman -Qlp package_file.pkg.tar.zst
24 changes: 24 additions & 0 deletions microemacs/packages/msys2/PKGBUILD.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Maintainer: Detlef Groth <your@email.com>

pkgname=microemacs
pkgver=24.09.02
pkgrel=1
pkgdesc="Jasspa MicroEmacs Text Editor"
arch=('x86_64')
url="https://github.com/bjasspa/jasspa"
license=('GPL')
source=("mec.exe" "mew.exe","readme.txt" "COPYING.txt", "macros/")
sha256sums=(
'digest-mec.exe'
'digest-mew.exe'
'digest-readme.txt'
'digest-COPYING.txt'
'SKIP')

package() {
install -Dm755 "${srcdir}/bin/windows100-intel32/mec.exe" "${pkgdir}/usr/bin/mec.exe"
install -Dm755 "${srcdir}/bin/windows100-intel32/mec.exe" " "${pkgdir}/usr/bin/mew.exe"
install -Dm644 "${srcdir}/readme.txt" "${pkgdir}/usr/share/jasspa/readme.txt"
install -Dm644 "${srcdir}/COPYING.txt" "${pkgdir}/usr/share/jasspa/COPYING.txt"
install -Dm644 "${srcdir}/macros/*" "${pkgdir}/usr/share/jasspa/macros/*"
}
40 changes: 40 additions & 0 deletions microemacs/packages/msys2/tpl2pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash


function tpl2pkg {
if [ -z $2 ]; then
printf "tpl2pkg VERSION TEMPLATE\n"
else
version=$(echo $1 | sed -E 's/.+MicroEmacs_([0-9]+).+/\1/') #'
outfile=$(echo $2 | sed -E 's/.tpl$//')
printf "$version $outfile\n"
dld="https://github.com/bjasspa/jasspa/releases/download/me_${version}"
if [ ! -f "Jasspa_MicroEmacs_${version}_bin_windows_binaries.zip" ]; then
wget "${dld}/Jasspa_MicroEmacs_${version}_bin_windows_binaries.zip"
fi
if [ ! -f "Jasspa_MicroEmacs_${version}_macros.zip" ]; then
wget "${dld}/Jasspa_MicroEmacs_${version}_macros.zip"
fi
if [ ! -f "Jasspa_MicroEmacs_${version}_help_ehf.zip" ]; then
wget "${dld}/Jasspa_MicroEmacs_${version}_help_ehf.zip"
fi
if [ -d "microemacs-package" ]; then
rm -rf microemacs-package
fi
mkdir microemacs-package
unzip -o Jasspa_MicroEmacs_${version}_bin_windows_binaries.zip -d microemacs-package
unzip -o Jasspa_MicroEmacs_${version}_macros.zip -d microemacs-package
unzip -o Jasspa_MicroEmacs_${version}_help_ehf.zip -d microemacs-package
mv microemacs-package/bin/*/me?.exe microemacs-package/
dig=$(sha256sum microemacs-package/mec.exe | cut -c 1-64)
sed -E "s/digest-mec.exe/${dig}/" $2 > microemacs-package/PKGBUILD
dig=$(sha256sum microemacs-package/mew.exe | cut -c 1-64)
sed -i -E "s/digest-mew.exe/${dig}/" microemacs-package/PKGBUILD
dig=$(sha256sum microemacs-package/readme.txt | cut -c 1-64)
sed -i -E "s/digest-readme.txt/${dig}/" microemacs-package/PKGBUILD
dig=$(sha256sum microemacs-package/COPYING.txt | cut -c 1-64)
sed -i -E "s/digest-COPYING.txt/${dig}/" microemacs-package/PKGBUILD
fi
}

tpl2pkg $1 $2

0 comments on commit 515f2ac

Please sign in to comment.