Skip to content

Commit

Permalink
Modify rpmbuild directives for pyside compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Mar 9, 2023
1 parent 8107e6f commit 3828f9d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 32 deletions.
28 changes: 17 additions & 11 deletions src/briefcase/platforms/linux/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,23 @@ def _package_rpm(self, app: AppConfig, **kwargs):
# tell you that it will remove the executable bit -
# even if the executable bit isn't set.
# We disable the processor that does this.
"%undefine __brp_mangle_shebangs",
"%global __brp_mangle_shebangs %{nil}",
# rpmbuild tries to strip binaries, which messes with
# binary wheels. Disable these checks.
"%global __brp_strip %{nil}",
"%global __brp_strip_static_archive %{nil}",
"%global __brp_strip_comment_note %{nil}",
# Disable RPATH checking, because check-rpaths can't deal with
# the structure of manylinux wheels
"%global __brp_check_rpaths %{nil}",
# Disable all the auto-detection that tries to magically
# determine requirements from the binaries
f"%global __requires_exclude_from ^%{{_libdir}}/{app.app_name}/.*$",
f"%global __provides_exclude_from ^%{{_libdir}}/{app.app_name}/.*$",
# Disable debug processing.
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"",
# Base package metadata
f"Name: {app.app_name}",
f"Version: {app.version}",
Expand All @@ -900,16 +916,6 @@ def _package_rpm(self, app: AppConfig, **kwargs):
"%description",
app.long_description,
"",
# Disable all the auto-detection that tries to magically
# determine requirements from the binaries
f"%global __requires_exclude /usr/lib/{app.app_name}",
f"%global __provides_exclude /usr/lib/{app.app_name}",
# Disable all build post-processing so that binary
# wheels aren't munged.
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"%global __os_install_post /usr/lib/rpm/brp-compress %{nil}",
"",
"%prep",
"%autosetup",
"",
Expand Down
51 changes: 30 additions & 21 deletions tests/platforms/linux/system/test_package__rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,16 @@ def test_rpm_package(package_command, first_app_rpm, tmp_path):
) as f:
assert f.read() == "\n".join(
[
"%undefine __brp_mangle_shebangs",
"%global __brp_mangle_shebangs %{nil}",
"%global __brp_strip %{nil}",
"%global __brp_strip_static_archive %{nil}",
"%global __brp_strip_comment_note %{nil}",
"%global __brp_check_rpaths %{nil}",
"%global __requires_exclude_from ^%{_libdir}/first-app/.*$",
"%global __provides_exclude_from ^%{_libdir}/first-app/.*$",
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"",
"Name: first-app",
"Version: 0.0.1",
"Release: 1%{?dist}",
Expand All @@ -186,12 +195,6 @@ def test_rpm_package(package_command, first_app_rpm, tmp_path):
"Long description",
"for the app",
"",
"%global __requires_exclude /usr/lib/first-app",
"%global __provides_exclude /usr/lib/first-app",
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"%global __os_install_post /usr/lib/rpm/brp-compress %{nil}",
"",
"%prep",
"%autosetup",
"",
Expand Down Expand Up @@ -313,7 +316,16 @@ def test_rpm_re_package(package_command, first_app_rpm, tmp_path):
) as f:
assert f.read() == "\n".join(
[
"%undefine __brp_mangle_shebangs",
"%global __brp_mangle_shebangs %{nil}",
"%global __brp_strip %{nil}",
"%global __brp_strip_static_archive %{nil}",
"%global __brp_strip_comment_note %{nil}",
"%global __brp_check_rpaths %{nil}",
"%global __requires_exclude_from ^%{_libdir}/first-app/.*$",
"%global __provides_exclude_from ^%{_libdir}/first-app/.*$",
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"",
"Name: first-app",
"Version: 0.0.1",
"Release: 1%{?dist}",
Expand All @@ -331,12 +343,6 @@ def test_rpm_re_package(package_command, first_app_rpm, tmp_path):
"Long description",
"for the app",
"",
"%global __requires_exclude /usr/lib/first-app",
"%global __provides_exclude /usr/lib/first-app",
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"%global __os_install_post /usr/lib/rpm/brp-compress %{nil}",
"",
"%prep",
"%autosetup",
"",
Expand Down Expand Up @@ -477,7 +483,16 @@ def test_rpm_package_extra_requirements(package_command, first_app_rpm, tmp_path
) as f:
assert f.read() == "\n".join(
[
"%undefine __brp_mangle_shebangs",
"%global __brp_mangle_shebangs %{nil}",
"%global __brp_strip %{nil}",
"%global __brp_strip_static_archive %{nil}",
"%global __brp_strip_comment_note %{nil}",
"%global __brp_check_rpaths %{nil}",
"%global __requires_exclude_from ^%{_libdir}/first-app/.*$",
"%global __provides_exclude_from ^%{_libdir}/first-app/.*$",
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"",
"Name: first-app",
"Version: 0.0.1",
"Release: 42%{?dist}",
Expand All @@ -497,12 +512,6 @@ def test_rpm_package_extra_requirements(package_command, first_app_rpm, tmp_path
"Long description",
"for the app",
"",
"%global __requires_exclude /usr/lib/first-app",
"%global __provides_exclude /usr/lib/first-app",
"%global _enable_debug_package 0",
"%global debug_package %{nil}",
"%global __os_install_post /usr/lib/rpm/brp-compress %{nil}",
"",
"%prep",
"%autosetup",
"",
Expand Down

0 comments on commit 3828f9d

Please sign in to comment.