Remove framework-only links when packaging VLC-release.app
[vlc.git] / projects / macosx / framework / Pre-Compile.sh
index 90876ae..4065f4a 100644 (file)
@@ -90,17 +90,21 @@ if test "${ACTION}" = "build"; then
     ##########################
     # Hack for VLC-release.app
     if [ "$FULL_PRODUCT_NAME" = "VLC-release.app" ] ; then
-        install_library "${VLC_BUILD_DIR}/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
         prefix=".libs/"
+        install_library "${VLC_BUILD_DIR}/src/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
+        mv ${target}/vlc ${target}/VLC
+        chmod +x ${target}/VLC
+        suffix="dylib"
     else
         prefix=""
+        suffix="so"
     fi
 
     ##########################
     # Build the modules folder (Same as VLCKit.framework/modules in Makefile)
     echo "Building modules folder..."
     # Figure out what modules are available to install
-    for module in `find ${VLC_BUILD_DIR}/modules -name *.so` ; do
+    for module in `find ${VLC_BUILD_DIR}/modules -name *.${suffix}` ; do
         # Check to see that the reported module actually exists
         if test -n ${module}; then
             install_library ${module} ${target_modules} "module"
@@ -113,28 +117,23 @@ if test "${ACTION}" = "build"; then
     # Create a symbolic link in the root of the framework
     mkdir -p ${target_lib}
     mkdir -p ${target_modules}
-    
-    pushd `pwd` > /dev/null 
-    cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}
-    
-    ln -sf Versions/Current/${lib} .
-    ln -sf Versions/Current/${modules} .
-    
-    popd > /dev/null 
-    # Create a symbolic link in the root of the framework
-    ##########################
-    
+
+    if [ "$FULL_PRODUCT_NAME" != "VLC-release.app" ] ; then
+        pushd `pwd` > /dev/null
+        cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}
+
+        ln -sf Versions/Current/${lib} .
+        ln -sf Versions/Current/${modules} .
+
+        popd > /dev/null
+    fi
+
     ##########################
     # Build the library folder
     echo "Building library folder... ${linked_libs}"
     for linked_lib in ${linked_libs} ; do
         case "${linked_lib}" in
-            */extras/contrib/lib/*.dylib)
-                if test -e ${linked_lib}; then
-                    install_library ${linked_lib} ${target_lib} "library"
-                fi
-                ;;
-            */vlc_install_dir/lib/*.dylib)
+            */extras/contrib/lib/*.dylib|*/vlc_install_dir/lib/*.dylib)
                 if test -e ${linked_lib}; then
                     install_library ${linked_lib} ${target_lib} "library"
                 fi
@@ -149,8 +148,7 @@ if test "${ACTION}" = "build"; then
     ##########################
     # Build the share folder
     echo "Building share folder..."
-    pbxcp="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks"
+    pbxcp="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -resolve-src-symlinks"
     mkdir -p ${target_share}
-    $pbxcp ${VLC_SRC_DIR}/share/luameta ${target_share}
-    $pbxcp ${VLC_SRC_DIR}/share/luaplaylist ${target_share}
+    $pbxcp ${VLC_SRC_DIR}/share/lua ${target_share}
 fi