Fix: Pass RELEASE_BUILD=ON to CMake in debian/rules for release scope builds
- Modified create_debian_rules() to accept cmake_flags parameter - Updated build_deb() to pass -DRELEASE_BUILD=ON when release_scope=True - This ensures LtsUtilsGuiDds is properly excluded from release builds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 file changed
+24
-5
+24
-5
@@ -241,14 +241,24 @@ def create_debian_changelog(deb_dir, project_name, version, build_number):
|
|||||||
info(f"Created {changelog_file}")
|
info(f"Created {changelog_file}")
|
||||||
|
|
||||||
|
|
||||||
def create_debian_rules(deb_dir):
|
def create_debian_rules(deb_dir, cmake_flags=""):
|
||||||
"""Create debian/rules file"""
|
"""Create debian/rules file
|
||||||
rules_content = """#!/usr/bin/make -f
|
|
||||||
|
Args:
|
||||||
|
deb_dir: debian directory path
|
||||||
|
cmake_flags: Additional CMake flags to pass
|
||||||
|
"""
|
||||||
|
# Build CMake flags string
|
||||||
|
cmake_opts = "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr"
|
||||||
|
if cmake_flags:
|
||||||
|
cmake_opts = f"{cmake_opts} {cmake_flags}"
|
||||||
|
|
||||||
|
rules_content = f"""#!/usr/bin/make -f
|
||||||
%:
|
%:
|
||||||
dh $@ --buildsystem=cmake --builddirectory=build
|
dh $@ --buildsystem=cmake --builddirectory=build
|
||||||
|
|
||||||
override_dh_auto_configure:
|
override_dh_auto_configure:
|
||||||
dh_auto_configure -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
|
dh_auto_configure -- {cmake_opts}
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
dh_auto_build --parallel
|
dh_auto_build --parallel
|
||||||
@@ -302,7 +312,16 @@ def build_deb(source_dir, output_dir, project_name, version, build_number, cmake
|
|||||||
# Create debian control files
|
# Create debian control files
|
||||||
create_debian_control(deb_dir, project_name, version, build_number, cmake_flags)
|
create_debian_control(deb_dir, project_name, version, build_number, cmake_flags)
|
||||||
create_debian_changelog(deb_dir, project_name, version, build_number)
|
create_debian_changelog(deb_dir, project_name, version, build_number)
|
||||||
create_debian_rules(deb_dir)
|
|
||||||
|
# Add RELEASE_BUILD=ON for release scope builds
|
||||||
|
deb_cmake_flags = cmake_flags
|
||||||
|
if release_scope:
|
||||||
|
if deb_cmake_flags:
|
||||||
|
deb_cmake_flags = f"{deb_cmake_flags} -DRELEASE_BUILD=ON"
|
||||||
|
else:
|
||||||
|
deb_cmake_flags = "-DRELEASE_BUILD=ON"
|
||||||
|
|
||||||
|
create_debian_rules(deb_dir, deb_cmake_flags)
|
||||||
|
|
||||||
# Create debian/source/format
|
# Create debian/source/format
|
||||||
source_dir_path = os.path.join(deb_dir, "source")
|
source_dir_path = os.path.join(deb_dir, "source")
|
||||||
|
|||||||
Reference in new issue
Block a user