Skip to content

Commit

Permalink
addpkg: ruby-iostruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeonacid committed Jan 19, 2025
1 parent 94474c7 commit cf20ae4
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
5 changes: 5 additions & 0 deletions archlinuxcn/ruby-iostruct/.nvchecker.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ruby-iostruct]
source = "git"
git = "https://github.com/zed-0xff/iostruct.git"
use_max_tag = true
prefix = "v"
71 changes: 71 additions & 0 deletions archlinuxcn/ruby-iostruct/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Maintainer: Xeonacid <[email protected]>

_name=iostruct
pkgname=ruby-${_name}
pkgver=0.4.0
pkgrel=1
pkgdesc="A Struct that can read/write itself from/to IO-like objects"
arch=(any)
url="https://github.com/zed-0xff/${_name}"
license=(MIT)
depends=(ruby)
makedepends=(git)
source=("git+$url.git#tag=v$pkgver")
sha256sums=('53ad352d8994c0cc805140d11d04626af5f29a21b50f2a3e83f158cc555ea8e0')

prepare() {
cd "${_name}"

# update gemspec/Gemfile to allow newer version of the dependencies
sed --in-place --regexp-extended 's|~>|>=|g' "${_name}.gemspec"
}

build() {
cd "${_name}"

local _gemdir="$(gem env gemdir)"

gem build "${_name}.gemspec"

gem install \
--local \
--verbose \
--ignore-dependencies \
--build-root "tmp_install" \
"${_name}-${pkgver}.gem"

# remove unrepreducible files
rm --force --recursive --verbose \
"tmp_install/${_gemdir}/cache/" \
"tmp_install/${_gemdir}/gems/${_name}-${pkgver}/vendor/" \
"tmp_install/${_gemdir}/doc/${_name}-${pkgver}/ri/ext/"

find "tmp_install/${_gemdir}/gems/" \
-type f \
\( \
-iname "*.o" -o \
-iname "*.c" -o \
-iname "*.so" -o \
-iname "*.time" -o \
-iname "gem.build_complete" -o \
-iname "Makefile" \
\) \
-delete

find "tmp_install/${_gemdir}/extensions/" \
-type f \
\( \
-iname "mkmf.log" -o \
-iname "gem_make.out" \
\) \
-delete
}

package() {
cd "${_name}"

cp --archive --verbose tmp_install/* "${pkgdir}"

install --verbose -D --mode=0644 LICENSE.txt --target-directory "${pkgdir}/usr/share/licenses/${pkgname}"
install --verbose -D --mode=0644 README.md --target-directory "${pkgdir}/usr/share/doc/${pkgname}"
}
15 changes: 15 additions & 0 deletions archlinuxcn/ruby-iostruct/lilac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
maintainers:
- github: Xeonacid
email: [email protected]

pre_build_script: update_pkgver_and_pkgrel(_G.newver)

post_build_script: |
git_pkgbuild_commit()
update_on:
- source: github
github: zed-0xff/iostruct
use_max_tag: true
prefix: v
- alias: ruby

0 comments on commit cf20ae4

Please sign in to comment.