diff --git a/internal/rosa/package/wayland/build-only.patch b/internal/rosa/package/wayland/build-only.patch new file mode 100644 index 00000000..22765173 --- /dev/null +++ b/internal/rosa/package/wayland/build-only.patch @@ -0,0 +1,50 @@ +From 8b4c76275fa1b6e0a99a53494151d9a2c907144d Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Fri, 8 Nov 2024 11:27:25 -0600 +Subject: [PATCH] tests: Make build-only tests actually build-only + +The goal behind the pedantic compiler tests are to ensure that the code +that wayland-scanner is generating can be compiled in pedantic mode by +the system C compiler. + +Trying to execute the built tests may fail because of undefined symbols. +This affects certain platforms more than others; Linux/musl and Darwin +are examples of platforms that cannot execute binaries with undefined +symbols. This meant tests needlessly failed on these platforms. + +Signed-off-by: A. Wilcox +Closes: #48, #228 +--- + tests/meson.build | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tests/meson.build b/tests/meson.build +index aa216ec2..5a93bb36 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -1,4 +1,5 @@ + prog_scan_sh = find_program('scan.sh') ++prog_true = find_program('true') + + libwayland = [ + dependency('wayland-client'), +@@ -100,7 +101,7 @@ foreach protocol_file : protocol_files + test_source, + client_header, + server_header, +- code ++ code, + ], + link_args: extra_linker_flags, + dependencies: libwayland, +@@ -111,7 +112,7 @@ foreach protocol_file : protocol_files + '-Werror' ], + install: false, + ) +- test(test_name, pedantic_test_executable) ++ test(test_name, prog_true, depends : [pedantic_test_executable]) + + # Check that the header + if not protocol_file.contains('xdg-foreign-unstable-v1') +-- +GitLab diff --git a/internal/rosa/package/wayland/package.az b/internal/rosa/package/wayland/package.az new file mode 100644 index 00000000..a4a374c8 --- /dev/null +++ b/internal/rosa/package/wayland/package.az @@ -0,0 +1,61 @@ +package wayland { + description = "core Wayland window system code and protocol"; + website = "https://wayland.freedesktop.org"; + anitya = 10061; + + version* = "1.25.0"; + source = remoteGitLab { + domain = "gitlab.freedesktop.org"; + suffix = "wayland/wayland"; + ref = version; + checksum = "q-4dYXme46JPgLGtXAxyZGTy7udll9RfT0VXtcW2YRR1WWViUhvdZXZneXzLqpCg"; + }; + + writable = true; + early = ` +chmod +w tests tests/sanity-test.c +echo 'int main(){}' > tests/sanity-test.c +`; + + exec = meson { + setup = { + "Ddefault_library": "both"; + "Ddocumentation": "false"; + "Dtests": "true"; + }; + }; + + inputs = [ + gawk, + diffutils, + + libffi, + libexpat, + libxml2, + ]; + + runtime = [ + libffi, + libexpat, + libxml2, + ]; +} + +package wayland-protocols { + description = "additional standard Wayland protocols"; + website = "https://wayland.freedesktop.org"; + anitya = 13997; + + version* = "1.48"; + source = remoteGitLab { + domain = "gitlab.freedesktop.org"; + suffix = "wayland/wayland-protocols"; + ref = version; + checksum = "xvfHCBIzXGwOqOu9b8dfhGw_U29Pd-g4JBwpYIaxee8SwEbxi6NaVU-Y1Q7wY4jK"; + }; + patches = [ "build-only.patch" ]; + + exec = meson {}; + + inputs = [ wayland ]; +} diff --git a/internal/rosa/wayland.go b/internal/rosa/wayland.go deleted file mode 100644 index 5b33214b..00000000 --- a/internal/rosa/wayland.go +++ /dev/null @@ -1,129 +0,0 @@ -package rosa - -import "hakurei.app/internal/pkg" - -func (t Toolchain) newWayland() (pkg.Artifact, string) { - const ( - version = "1.25.0" - checksum = "q-4dYXme46JPgLGtXAxyZGTy7udll9RfT0VXtcW2YRR1WWViUhvdZXZneXzLqpCg" - ) - return t.NewPackage("wayland", version, newFromGitLab( - "gitlab.freedesktop.org", - "wayland/wayland", - version, - checksum, - ), &PackageAttr{ - Writable: true, - ScriptEarly: ` -cd /usr/src/wayland -chmod +w tests tests/sanity-test.c -echo 'int main(){}' > tests/sanity-test.c -`, - }, &MesonHelper{ - Setup: []KV{ - {"Ddefault_library", "both"}, - {"Ddocumentation", "false"}, - {"Dtests", "true"}, - }, - }, - Gawk, - Diffutils, - - Libffi, - Libexpat, - Libxml2, - ), version -} -func init() { - native.mustRegister(Toolchain.newWayland, &Metadata{ - Name: "wayland", - Description: "core Wayland window system code and protocol", - Website: "https://wayland.freedesktop.org/", - - Dependencies: P{ - Libffi, - Libexpat, - Libxml2, - }, - - ID: 10061, - }) -} - -func (t Toolchain) newWaylandProtocols() (pkg.Artifact, string) { - const ( - version = "1.48" - checksum = "xvfHCBIzXGwOqOu9b8dfhGw_U29Pd-g4JBwpYIaxee8SwEbxi6NaVU-Y1Q7wY4jK" - ) - return t.NewPackage("wayland-protocols", version, newFromGitLab( - "gitlab.freedesktop.org", - "wayland/wayland-protocols", - version, - checksum, - ), &PackageAttr{ - Patches: []KV{ - {"build-only", `From 8b4c76275fa1b6e0a99a53494151d9a2c907144d Mon Sep 17 00:00:00 2001 -From: "A. Wilcox" -Date: Fri, 8 Nov 2024 11:27:25 -0600 -Subject: [PATCH] tests: Make build-only tests actually build-only - -The goal behind the pedantic compiler tests are to ensure that the code -that wayland-scanner is generating can be compiled in pedantic mode by -the system C compiler. - -Trying to execute the built tests may fail because of undefined symbols. -This affects certain platforms more than others; Linux/musl and Darwin -are examples of platforms that cannot execute binaries with undefined -symbols. This meant tests needlessly failed on these platforms. - -Signed-off-by: A. Wilcox -Closes: #48, #228 ---- - tests/meson.build | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/tests/meson.build b/tests/meson.build -index aa216ec2..5a93bb36 100644 ---- a/tests/meson.build -+++ b/tests/meson.build -@@ -1,4 +1,5 @@ - prog_scan_sh = find_program('scan.sh') -+prog_true = find_program('true') - - libwayland = [ - dependency('wayland-client'), -@@ -100,7 +101,7 @@ foreach protocol_file : protocol_files - test_source, - client_header, - server_header, -- code -+ code, - ], - link_args: extra_linker_flags, - dependencies: libwayland, -@@ -111,7 +112,7 @@ foreach protocol_file : protocol_files - '-Werror' ], - install: false, - ) -- test(test_name, pedantic_test_executable) -+ test(test_name, prog_true, depends : [pedantic_test_executable]) - - # Check that the header - if not protocol_file.contains('xdg-foreign-unstable-v1') --- -GitLab -`}, - }, - }, (*MesonHelper)(nil), - Wayland, - ), version -} -func init() { - native.mustRegister(Toolchain.newWaylandProtocols, &Metadata{ - Name: "wayland-protocols", - Description: "Additional standard Wayland protocols", - Website: "https://wayland.freedesktop.org/", - - ID: 13997, - }) -}