Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch.mk: create target subdir if it is multilevel #1454

Closed
wants to merge 1 commit into from

Conversation

starius
Copy link
Member

@starius starius commented Jul 24, 2016

Example: xvidcore. Its subdir is xvidcore/build/generic.
This commit adds creation of xvidcore/build prior to moving
a directory to xvidcore/build/generic.

Example: xvidcore. Its subdir is xvidcore/build/generic.
This commit adds creation of xvidcore/build prior to moving
a directory to xvidcore/build/generic.
@tonytheodore
Copy link
Member

In this case, subdir should be changed to the top level so that all files are tracked and able to be patched.

@tonytheodore
Copy link
Member

Something like the below (untested):

diff --git a/src/xvidcore.mk b/src/xvidcore.mk
index 3d8a4f2..94bf92d 100644
--- a/src/xvidcore.mk
+++ b/src/xvidcore.mk
@@ -5,7 +5,7 @@ PKG             := xvidcore
 $(PKG)_IGNORE   :=
 $(PKG)_VERSION  := 1.3.4
 $(PKG)_CHECKSUM := 4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f
-$(PKG)_SUBDIR   := xvidcore/build/generic
+$(PKG)_SUBDIR   := xvidcore
 $(PKG)_FILE     := xvidcore-$($(PKG)_VERSION).tar.gz
 $(PKG)_URL      := http://downloads.xvid.org/downloads/$($(PKG)_FILE)
 $(PKG)_DEPS     := gcc pthreads yasm
@@ -17,22 +17,21 @@ define $(PKG)_UPDATE
 endef

 define $(PKG)_BUILD
-    $(SED) -i 's,yasm_prog="yasm",yasm_prog="$(TARGET)-yasm",' '$(1)/configure.in'
-    cd '$(1)' && autoreconf -fi
-    cd '$(1)' && ./configure \
+    $(SED) -i 's,yasm_prog="yasm",yasm_prog="$(TARGET)-yasm",' '$(SOURCE_DIR)/build/generic/configure.in'
+    cd '$(SOURCE_DIR)/build/generic' && autoreconf -fi
+    cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/build/generic/configure' \
         $(MXE_CONFIGURE_OPTS)
-    $(MAKE) -C '$(1)' -j 1 BUILD_DIR='build' $(if $(BUILD_STATIC),SHARED,STATIC)_LIB=
+    $(MAKE) -C '$(BUILD_DIR)' -j 1 $(if $(BUILD_STATIC),SHARED,STATIC)_LIB=
     $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
-    $(INSTALL) -m644 '$(1)/../../src/xvid.h' '$(PREFIX)/$(TARGET)/include/'
+    $(INSTALL) -m644 '$(SOURCE_DIR)/src/xvid.h' '$(PREFIX)/$(TARGET)/include/'
     $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' '$(PREFIX)/$(TARGET)/bin'
-    $(INSTALL) -m644 '$(1)/build/xvidcore.$(LIB_SUFFIX)' '$(PREFIX)/$(TARGET)/$(if $(BUILD_STATIC),lib,bin)/'
+    $(INSTALL) -m644 '$(BUILD_DIR)/xvidcore.$(LIB_SUFFIX)' '$(PREFIX)/$(TARGET)/$(if $(BUILD_STATIC),lib,bin)/'
     $(if $(BUILD_STATIC), \
         ln -sf '$(PREFIX)/$(TARGET)/lib/xvidcore.$(LIB_SUFFIX)' '$(PREFIX)/$(TARGET)/lib/libxvidcore.$(LIB_SUFFIX)', \
-        mv '$(1)/build/xvidcore.dll.a' '$(1)/build/libxvidcore.dll.a' && \
-        $(INSTALL) -m644 '$(1)/build/libxvidcore.dll.a' '$(PREFIX)/$(TARGET)/lib/')
+        $(INSTALL) -m644 '$(BUILD_DIR)/xvidcore.dll.a' '$(PREFIX)/$(TARGET)/lib/libxvidcore.dll.a')
 endef

 define $(PKG)_BUILD_x86_64-w64-mingw32
-    $(SED) -i 's,yasm_prog="yasm",yasm_prog="$(TARGET)-yasm -DNO_PREFIX",' '$(1)/configure.in'
+    $(SED) -i 's,yasm_prog="yasm",yasm_prog="$(TARGET)-yasm -DNO_PREFIX",' '$(SOURCE_DIR)/build/generic/configure.in'
     $($(PKG)_BUILD)
 endef

starius added a commit to LuaAndC/mxe that referenced this pull request Jul 27, 2016
@starius
Copy link
Member Author

starius commented Jul 27, 2016

@tonytheodore
Your patch of xvidcore.mk does not work, because the package does not generate Makefile out-of-tree. Instead, BUILD_DIR=$(BUILD_DIR) should be passed to generate build artefacts in $(BUILD_DIR).

See #1460

@starius
Copy link
Member Author

starius commented Jul 27, 2016

There are other packages with / in subdir: #1461

@starius starius closed this Jul 27, 2016
@starius starius deleted the patch-tool-multilevel-subdir branch July 27, 2016 17:34
starius added a commit to LuaAndC/mxe that referenced this pull request Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants