Skip to content

Commit

Permalink
Always calculate libdir
Browse files Browse the repository at this point in the history
flatpak-builder relies on patched cmake and meson from
freedesktop-sdk to change libdir from lib64 to lib on 64bit
distributions. This dependency is *weird* since it's actually
flatpak that sets up the dynamic linker paths. Instead, put
responsibility for setting up correct libdir to flatpak-builder
always.
  • Loading branch information
nanonyme authored and TingPing committed Feb 24, 2024
1 parent ae86bde commit 8c036e0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/builder-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,8 @@ builder_module_build_helper (BuilderModule *self,
g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_PREFIX:PATH='%s'", prefix));
if (libdir)
g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_LIBDIR:PATH='%s'", libdir));
else
g_ptr_array_add (configure_args_arr, g_strdup_printf ("-DCMAKE_INSTALL_LIBDIR:PATH='%s/lib'", prefix));
g_ptr_array_add (configure_args_arr, g_strdup ("-G"));
g_ptr_array_add (configure_args_arr, g_strdup_printf ("%s", cmake_generator));
}
Expand All @@ -1800,6 +1802,8 @@ builder_module_build_helper (BuilderModule *self,
g_ptr_array_add (configure_args_arr, g_strdup_printf ("--prefix=%s", prefix));
if (libdir)
g_ptr_array_add (configure_args_arr, g_strdup_printf ("--libdir=%s", libdir));
else
g_ptr_array_add (configure_args_arr, g_strdup_printf ("--libdir=%s/lib", prefix));
}

g_ptr_array_add (configure_args_arr, configure_final_arg);
Expand Down
3 changes: 2 additions & 1 deletion tests/test-configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

if [ x$2 != 'x--some-arg' ] ; then
if [ x$3 != 'x--some-arg' ] ; then
echo $*
exit 2
fi

Expand Down
2 changes: 1 addition & 1 deletion tests/test-rename-appdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"type": "file",
"path": "test-configure",
"dest-filename": "configure",
"sha256": "675a1ac2feec4d4f54e581b4b01bc3cfd2c1cf31aa5963574d31228c8a11b7e7"
"sha256": "2c661bff6567f0e26e3a4bc5548f5a81ff86e052ccaa3791b847201be84f932f"
},
{
"type": "file",
Expand Down
2 changes: 1 addition & 1 deletion tests/test-rename.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"type": "file",
"path": "test-configure",
"dest-filename": "configure",
"sha256": "675a1ac2feec4d4f54e581b4b01bc3cfd2c1cf31aa5963574d31228c8a11b7e7"
"sha256": "2c661bff6567f0e26e3a4bc5548f5a81ff86e052ccaa3791b847201be84f932f"
},
{
"type": "file",
Expand Down
2 changes: 1 addition & 1 deletion tests/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"type": "file",
"path": "test-configure",
"dest-filename": "configure",
"sha256": "675a1ac2feec4d4f54e581b4b01bc3cfd2c1cf31aa5963574d31228c8a11b7e7"
"sha256": "2c661bff6567f0e26e3a4bc5548f5a81ff86e052ccaa3791b847201be84f932f"
},
{
"type": "file",
Expand Down
2 changes: 1 addition & 1 deletion tests/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ modules:
- type: file
path: test-configure
dest-filename: configure
sha256: 675a1ac2feec4d4f54e581b4b01bc3cfd2c1cf31aa5963574d31228c8a11b7e7
sha256: 2c661bff6567f0e26e3a4bc5548f5a81ff86e052ccaa3791b847201be84f932f
- type: file
path: app-data
- type: script
Expand Down

0 comments on commit 8c036e0

Please sign in to comment.