Skip to content

Commit

Permalink
expat: add patch to remove postfix d
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Aug 2, 2023
1 parent 9f8564d commit 0c6fc8f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From cefae9cae833348b5954edb9b214c477a212a434 Mon Sep 17 00:00:00 2001
From: Ignacio Casal Quinteiro <qignacio@amazon.com>
Date: Wed, 2 Aug 2023 12:43:56 +0200
Subject: [PATCH] CMakeLists: do not add postfix d in debug builds

---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72cf0b01..842f900c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -426,7 +426,7 @@ foreach(build_type_upper
RELWITHDEBINFO
)
if(WIN32 AND build_type_upper STREQUAL "DEBUG")
- set(_POSTFIX_DEBUG "d")
+ set(_POSTFIX_DEBUG "")
else()
set(_POSTFIX_DEBUG "") # needs a reset because of being looped
endif()
--
2.34.1

17 changes: 1 addition & 16 deletions gvsbuild/projects/expat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.

from pathlib import Path

from gvsbuild.utils.base_builders import CmakeProject
from gvsbuild.utils.base_expanders import Tarball
from gvsbuild.utils.base_project import Project, project_add
Expand All @@ -33,22 +31,9 @@ def __init__(self):
archive_url="https://github.com/libexpat/libexpat/releases/download/R_{major}_{minor}_{micro}/expat-{version}.tar.xz",
hash="ef2420f0232c087801abf705e89ae65f6257df6b7931d37846a193ef2e8cdcbe",
dependencies=["cmake", "ninja"],
patches=["0001-CMakeLists-do-not-add-postfix-d-in-debug-builds.patch"],
)

def build(self):
CmakeProject.build(self, use_ninja=True)
self.install(r".\COPYING share\doc\expat")

def post_install(self):
if self.builder.opts.configuration == "debug":
# Fontconfig is looking for libexpat, not libexpatd
bin_dir = Path(self.builder.gtk_dir) / "bin"
self.builder.exec_msys(
["mv", "libexpatd.dll", "libexpat.dll"],
working_dir=bin_dir,
)
lib_dir = Path(self.builder.gtk_dir) / "lib"
self.builder.exec_msys(
["mv", "libexpatd.lib", "libexpat.lib"],
working_dir=lib_dir,
)

0 comments on commit 0c6fc8f

Please sign in to comment.