Skip to content

Commit

Permalink
feat: add swtpm
Browse files Browse the repository at this point in the history
Add swtpm

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed May 25, 2023
1 parent 4c5d7fe commit 88ebb40
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
},
{
"matchPackageNames": [
"git://repo.or.cz/socat.git",
"json-c/json-c"
],
"versioning": "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d+)?\\.?(?<build>\\d+)?$"
Expand Down
25 changes: 25 additions & 0 deletions Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ vars:
git_sha256: 4893b8b98eefc9fdc4b0e7ca249e340004faa7804a433d17429e311e1fef21d2
git_sha512: 9ab41c64c6e666c314683bc4925535e037d43f947b8d327ff7d0379ac12899f4effcc2fe4e47b1ce652ad7140aa4f01f3b99f9cc0cf854cfeface1a5d3e1893e

# renovate: datasource=git-tags depName=https://gitlab.gnome.org/GNOME/glib.git
glib2_version: 2.76.3
glib2_sha256: c0be444e403d7c3184d1f394f89f0b644710b5e9331b54fa4e8b5037813ad32a
glib2_sha512: 291b8913918d411b679442b888f56893a857a77decfe428086c8bd1da1949498938ddb0bf254ed99d192e4a09b5e8cee1905fd6932ee642463fb229cac7c226e

# official source code uses mercurial https://gmplib.org/devel/repo-usage, so falling back to a GitHub mirror,
# renovate: datasource=github-tags extractVersion=^v(?<version>.*)$ depName=alisw/GMP
gmp_version: 6.2.1
Expand Down Expand Up @@ -164,6 +169,11 @@ vars:
gzip_sha256: ce5e03e519f637e1f814011ace35c4f87b33c0bbabeec35baf5fbd3479e91956
gzip_sha512: 116326fe991828227de150336a0c016f4fe932dfbb728a16b4a84965256d9929574a4f5cfaf3cf6bb4154972ef0d110f26ab472c93e62ec9a5fd7a5d65abea24

# renovate: datasource=git-tags depName=https://gitlab.gnome.org/GNOME/json-glib.git
json_glib_version: 1.6.6
json_glib_sha256: 96ec98be7a91f6dde33636720e3da2ff6ecbb90e76ccaa49497f31a6855a490e
json_glib_sha512: b9a737e4ba3ecdfb9cb8f5fb751cc74e5b1553664d3088c44a1f9e5396d4037958af214dcd290ddf5af98088f46167e10e371e134e1de5cbb7aec84c5c0fd017

# renovate: datasource=git-tags extractVersion=^v(?<version>.*)$ depName=git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git
kmod_version: 30
kmod_sha256: f897dd72698dc6ac1ef03255cd0a5734ad932318e4adbaebc7338ef2f5202f9f
Expand Down Expand Up @@ -214,6 +224,11 @@ vars:
libtool_sha256: 04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8
libtool_sha512: 27acef46d9eb67203d708b57d80b853f76fa4b9c2720ff36ec161e6cdf702249e7982214ddf60bae75511aa79bc7d92aa27e3eab7ef9c0f5c040e8e42e76a385

# renovate: datasource=github-releases depName=stefanberger/libtpms
libtpms_version: v0.9.6
libtpms_sha256: 2807466f1563ebe45fdd12dd26e501e8a0c4fbb99c7c428fbb508789efd221c0
libtpms_sha512: 35f26e4849eb98cd73461aff439c19f77bbbcde9b7661402e3d419354c4dcddd057349c4f7178573f1ceea2e95326498eb9afea3bd48064bbff534fc7f6939c3

# renovate: datasource=github-tags depName=libuv/libuv
libuv_version: v1.44.2
libuv_sha256: ccfcdc968c55673c6526d8270a9c8655a806ea92468afcbcabc2b16040f03cb4
Expand Down Expand Up @@ -330,6 +345,11 @@ vars:
sed_sha256: 6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d24975181
sed_sha512: 36157a4b4a2430cf421b7bd07f1675d680d9f1616be96cf6ad6ee74a9ec0fe695f8d0b1e1f0b008bbb33cc7fcde5e1c456359bbbc63f8aebdd4fedc3982cf6dc

# renovate: datasource=git-tags extractVersion=^tag-(?<version>.*)$ depName=git://repo.or.cz/socat.git
socat_version: 1.7.4.4
socat_sha256: 0f8f4b9d5c60b8c53d17b60d79ababc4a0f51b3bb6d2bd3ae8a6a4b9d68f195e
socat_sha512: 709fd393642d4249152d75add4d489ea76e6118c9e6740e796f029e8c5ddd4f5c9218d587977fc57ada640f635a996cbbe4055275236a169881bb2be1d3e5df9

# renovate: datasource=github-tags depName=plougher/squashfs-tools
squashfs_tools_version: 4.6.1
squashfs_tools_sha256: 94201754b36121a9f022a190c75f718441df15402df32c2b520ca331a107511c
Expand All @@ -340,6 +360,11 @@ vars:
swig_sha256: 2af08aced8fcd65cdb5cc62426768914bedc735b1c250325203716f78e39ac9b
swig_sha512: 1cea1918455a75ebc9b2653dd1715bd5dcd974554955f324295c6a6f14c0a715651b221b85fad4a8af5197e0c75bfe7b590bc6ba7178c26245fbbd9a7e110100

# renovate: datasource=github-releases depName=stefanberger/swtpm
swtpm_version: v0.8.0
swtpm_sha256: ad433f9272fb794aafd550914d24cc0ca33d4652cfd087fa41b911fa9e54be3d
swtpm_sha512: 7f70c19f732404061be6168c96c0dd3ec91ed8b50dddcafcb50d810062ce0e83ad85360191f97db5db9dc034e01d91cebe3912449d896d2cde68fe060a0adb09

# renovate: datasource=github-releases depName=systemd/systemd
systemd_version: 253
systemd_sha256: acbd86d42ebc2b443722cb469ad215a140f504689c7a9133ecf91b235275a491
Expand Down
49 changes: 49 additions & 0 deletions glib2/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: glib2
dependencies:
- stage: base
- stage: pkg-config
runtime: true
- stage: meson
runtime: true
- stage: coreutils
- stage: libffi
- stage: openssl
- stage: pcre
- stage: python3
- stage: zlib
steps:
- sources:
- url: https://download.gnome.org/sources/glib/{{ regexReplaceAll ".\\d+$" .glib2_version "${1}" }}/glib-{{ .glib2_version }}.tar.xz
destination: glib2.tar.gz
sha256: "{{ .glib2_sha256 }}"
sha512: "{{ .glib2_sha512 }}"
env:
LD_LIBRARY_PATH: "/toolchain/lib"
prepare:
- |
tar -xf glib2.tar.gz --strip-components=1
mkdir -p /usr/bin
ln -sf /toolchain/bin/env /usr/bin/env
ln -sf /toolchain/bin/python3 /toolchain/bin/python
pip3 install jinja2 ninja
meson setup build \
--prefix=${TOOLCHAIN} \
--buildtype=release \
-Dman=false \
-Dtests=false \
-Dglib_debug=disabled \
-Dglib_assert=false \
-Dglib_checks=false \
build:
- |
ninja -j $(nproc) -C build
install:
- |
DESTDIR=/rootfs ninja -C build install
rm -rf /rootfs/toolchain/share
finalize:
- from: /rootfs
to: /
47 changes: 47 additions & 0 deletions json-glib/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: json-glib
dependencies:
- stage: base
- stage: pkg-config
runtime: true
- stage: meson
runtime: true
- stage: coreutils
- stage: glib2
- stage: libffi
- stage: openssl
- stage: pcre
- stage: python3
- stage: zlib
steps:
- sources:
- url: https://download.gnome.org/sources/json-glib/{{ regexReplaceAll ".\\d+$" .json_glib_version "${1}" }}/json-glib-{{ .json_glib_version }}.tar.xz
destination: json-glib.tar.gz
sha256: "{{ .json_glib_sha256 }}"
sha512: "{{ .json_glib_sha512 }}"
env:
LD_LIBRARY_PATH: "/toolchain/lib"
prepare:
- |
tar -xf json-glib.tar.gz --strip-components=1
mkdir -p /usr/bin
ln -sf /toolchain/bin/env /usr/bin/env
ln -sf /toolchain/bin/python3 /toolchain/bin/python
export PKG_CONFIG_PATH=${TOOLCHAIN}/lib/pkgconfig
pip3 install jinja2 ninja
meson setup build \
--prefix=${TOOLCHAIN} \
--buildtype=release \
-Dtests=false
build:
- |
ninja -C build -j $(nproc)
install:
- |
DESTDIR=/rootfs ninja -C build install
finalize:
- from: /rootfs
to: /
35 changes: 35 additions & 0 deletions libtpms/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: libtpms
dependencies:
- stage: base
- stage: autoconf
runtime: true
- stage: automake
runtime: true
- stage: pkg-config
runtime: true
- stage: libtool
- stage: openssl
steps:
- sources:
- url: https://github.com/stefanberger/libtpms/archive/refs/tags/{{ .libtpms_version }}.tar.gz
destination: libtpms.tar.gz
sha256: "{{ .libtpms_sha256 }}"
sha512: "{{ .libtpms_sha512 }}"
prepare:
- |
tar -xf libtpms.tar.gz --strip-components=1
./autogen.sh \
--with-tpm2 \
--with-openssl \
--prefix=${TOOLCHAIN}
build:
- |
make -j $(nproc)
install:
- |
make DESTDIR=/rootfs install
rm -rf /rootfs/toolchain/share
finalize:
- from: /rootfs
to: /
13 changes: 13 additions & 0 deletions socat/patches/use-linux-headers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://git.alpinelinux.org/aports/plain/main/socat/use-linux-headers.patch
--- socat-1.7.2.4.orig/sysincludes.h
+++ socat-1.7.2.4/sysincludes.h
@@ -134,7 +134,7 @@
#include <netpacket/packet.h>
#endif
#if HAVE_NETINET_IF_ETHER_H
-#include <netinet/if_ether.h>
+#include <linux/if_ether.h>
#endif
#if HAVE_LINUX_IF_TUN_H
#include <linux/if_tun.h>

31 changes: 31 additions & 0 deletions socat/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: socat
dependencies:
- stage: base
- stage: openssl
- stage: patch
runtime: true
steps:
- sources:
- url: http://www.dest-unreach.org/socat/download/socat-{{ .socat_version }}.tar.gz
destination: socat.tar.gz
sha256: "{{ .socat_sha256 }}"
sha512: "{{ .socat_sha512 }}"
env:
BUILD_DATE: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }}
prepare:
- |
tar -xzf socat.tar.gz --strip-components=1
patch -p1 < /pkg/patches/use-linux-headers.patch
./configure \
--prefix=${TOOLCHAIN}
build:
- |
make -j $(nproc)
install:
- |
make install DESTDIR=/rootfs
finalize:
- from: /rootfs
to: /
45 changes: 45 additions & 0 deletions swtpm/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: swtpm
dependencies:
- stage: base
- stage: autoconf
runtime: true
- stage: automake
runtime: true
- stage: pkg-config
runtime: true
- stage: coreutils
- stage: expect
- stage: gawk
- stage: glib2
- stage: json-glib
- stage: libffi
- stage: libseccomp
- stage: libtasn1
- stage: libtool
- stage: libtpms
- stage: openssl
- stage: pcre
- stage: python3
- stage: socat
- stage: zlib
steps:
- sources:
- url: https://github.com/stefanberger/swtpm/archive/refs/tags/{{ .swtpm_version }}.tar.gz
destination: swtpm.tar.gz
sha256: "{{ .swtpm_sha256 }}"
sha512: "{{ .swtpm_sha512 }}"
prepare:
- |
tar -xf swtpm.tar.gz --strip-components=1
./autogen.sh \
--prefix=${TOOLCHAIN}
build:
- |
make -j $(nproc)
install:
- |
make DESTDIR=/rootfs install
finalize:
- from: /rootfs
to: /
23 changes: 14 additions & 9 deletions tools/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,35 @@ dependencies:
- stage: gawk
- stage: gettext
- stage: git
- stage: glib2
- stage: gmp
- stage: gnuefi
- stage: gnutls
- stage: golang
- stage: gperf
- stage: grep
- stage: gnuefi
- stage: gnutls
- stage: gzip
- stage: json-glib
- stage: kmod
- stage: libbpf
- stage: libcap
- stage: libffi
- stage: libjson-c
- stage: libnl
- stage: libtool
- stage: libcap
- stage: libuv
- stage: libtasn1
- stage: libtool
- stage: libtpms
- stage: libunistring
- stage: libuv
- stage: m4
- stage: make
- stage: meson
- stage: mpc
- stage: mpfr
- stage: musl-fts
- stage: musl-obstack
- stage: nettle
- stage: ncurses
- stage: nettle
- stage: openssl
- stage: pahole
- stage: patch
Expand All @@ -67,12 +70,14 @@ dependencies:
- stage: python3
- stage: rhash
- stage: sbsign
- stage: sed
- stage: squashfs-tools
- stage: swig
- stage: sd-boot
- stage: sd-measure
- stage: sd-stub
- stage: sed
- stage: socat
- stage: squashfs-tools
- stage: swig
- stage: swtpm
- stage: tar
- stage: tcl
- stage: texinfo
Expand Down

0 comments on commit 88ebb40

Please sign in to comment.