Skip to content

Commit

Permalink
3.100.2
Browse files Browse the repository at this point in the history
  • Loading branch information
BB9z committed Jul 6, 2024
2 parents 9dd1b8e + 1df7f87 commit d470bee
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 30 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ jobs:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: XCFramework Make
- name: Package XCFramework
run: |
cd macosx
./make-xcframework.sh
./make-package.command
env:
# Seems unable build visionOS at the moment
B9_BUILD_VISION_OS: false
4 changes: 2 additions & 2 deletions LAME-xcframework.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LAME-xcframework"
s.version = "3.100.1"
s.version = "3.100.2"
s.summary = "LAME.xcframework supports all Apple platforms."
s.description = <<-DESC
LAME is a high quality MPEG Audio Layer III (MP3) encoder licensed under the LGPL.
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.homepage = "https://github.com/BB9z/LAME-xcframework"
s.license = { :type => "LGPL", :file => "LICENSE" }
s.author = 'BB9z'
s.source = { :http => "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.1/LAME.xcframework.zip", :sha256 => "cc45eb59d17ec4c38f75bb054d01faca3aaefeeaee544ca0c7a07e6820898c0f" }
s.source = { :http => "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.2/LAME.xcframework.zip", :sha256 => "033f1582e6806ea94215dd20446e9138c03bf0c06bee37221e18a647f8c69b0f" }

s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
Expand Down
8 changes: 2 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ let package = Package(
],
dependencies: [],
targets: [
// .binaryTarget(
// name: "LAME",
// path: "macosx/LAME.xcframework"
// ),
.binaryTarget(
name: "LAME",
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.1/LAME.xcframework.zip",
checksum: "cc45eb59d17ec4c38f75bb054d01faca3aaefeeaee544ca0c7a07e6820898c0f"
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.2/LAME.xcframework.zip",
checksum: "033f1582e6806ea94215dd20446e9138c03bf0c06bee37221e18a647f8c69b0f"
)
]
)
4 changes: 2 additions & 2 deletions Package@swift-5.3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ let package = Package(
// ),
.binaryTarget(
name: "LAME",
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.1/LAME.xcframework.zip",
checksum: "cc45eb59d17ec4c38f75bb054d01faca3aaefeeaee544ca0c7a07e6820898c0f"
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.2/LAME.xcframework.zip",
checksum: "033f1582e6806ea94215dd20446e9138c03bf0c06bee37221e18a647f8c69b0f"
)
]
)
4 changes: 2 additions & 2 deletions Package@swift-5.5.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ let package = Package(
// ),
.binaryTarget(
name: "LAME",
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.1/LAME.xcframework.zip",
checksum: "cc45eb59d17ec4c38f75bb054d01faca3aaefeeaee544ca0c7a07e6820898c0f"
url: "https://github.com/BB9z/LAME-xcframework/releases/download/3.100.2/LAME.xcframework.zip",
checksum: "033f1582e6806ea94215dd20446e9138c03bf0c06bee37221e18a647f8c69b0f"
)
]
)
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project aims to archive [LAME](https://lame.sourceforge.io) into the xcfram

LAME.xcframework | Build with | macOS | iOS | tvOS | watchOS | visionOS
-----------------|--------------|--------|-------|-------|---------|---------
3.100.1 | Xcode 15.2 | 10.13+ | 12.0+ | 12.0+ | 4.0+ | 1.0+
3.100.2 | Xcode 15.4 | 10.13+ | 12.0+ | 12.0+ | 4.0+ | 1.0+
3.100.0 | Xcode 12.5.1 | 10.10+ | 9.0+ | 9.0+ | 2.0+ | NA

## Installation
Expand Down Expand Up @@ -62,3 +62,11 @@ Or use the following commands.
cd macosx
./make-xcframework.sh
```

## Maintenance Notes

### Release

1. Update version in xcconfig and podspec.
2. Make package.
3. Update package url and checksum in Package.swift and podspec.
14 changes: 12 additions & 2 deletions macosx/LAME.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
D50E02FE2B9372D90066CB31 /* vbrquantize.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F309A39A5E001379B8 /* vbrquantize.c */; };
D50E02FF2B9372D90066CB31 /* VbrTag.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F509A39A5E001379B8 /* VbrTag.c */; };
D50E03002B9372D90066CB31 /* version.c in Sources */ = {isa = PBXBuildFile; fileRef = EA8CC0F709A39A5E001379B8 /* version.c */; };
D546187A2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */; };
D546187B2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */; };
D546187C2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */; };
D546187D2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */; };
D546187E2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */; };
D55AAC5A26E8F9C100DD41EA /* LAME_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 32BAE0B70371A74B00C91783 /* LAME_Prefix.pch */; };
D55AAC5B26E8F9C100DD41EA /* lame.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC08709A39A49001379B8 /* lame.h */; settings = {ATTRIBUTES = (Public, ); }; };
D55AAC5C26E8F9C100DD41EA /* common.h in Headers */ = {isa = PBXBuildFile; fileRef = EA8CC08B09A39A55001379B8 /* common.h */; };
Expand Down Expand Up @@ -330,6 +335,7 @@
8D07F2C80486CC7A007CD1D0 /* LAME.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LAME.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D50E03052B9372D90066CB31 /* LAME.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LAME.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D50E032E2B937A410066CB31 /* Products */ = {isa = PBXFileReference; lastKnownFileType = text; name = Products; path = ..; sourceTree = BUILT_PRODUCTS_DIR; };
D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
D55AAC5726E8F72800DD41EA /* Lame-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Lame-Framework.xcconfig"; sourceTree = "<group>"; };
D55AAC9F26E8F9C100DD41EA /* LAME.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LAME.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D55AACE826E8FB3D00DD41EA /* LAME.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LAME.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -465,6 +471,7 @@
children = (
8D07F2C70486CC7A007CD1D0 /* Info.plist */,
D55AAC5726E8F72800DD41EA /* Lame-Framework.xcconfig */,
D54618792C38E5BA007E2E82 /* PrivacyInfo.xcprivacy */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -948,34 +955,39 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D546187A2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D50E02E32B9372D90066CB31 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D546187E2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D55AAC7D26E8F9C100DD41EA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D546187B2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D55AACC626E8FB3D00DD41EA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D546187C2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D55AAD0F26E8FBD100DD41EA /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D546187D2C38E5BA007E2E82 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1205,7 +1217,6 @@
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_OUTPUT_FORMAT = binary;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.13;
ONLY_ACTIVE_ARCH = YES;
PLIST_FILE_OUTPUT_FORMAT = binary;
Expand Down Expand Up @@ -1248,7 +1259,6 @@
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_OUTPUT_FORMAT = binary;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MACH_O_TYPE = mh_dylib;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PLIST_FILE_OUTPUT_FORMAT = binary;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES;
Expand Down
14 changes: 10 additions & 4 deletions macosx/Lame-Framework.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@
// Lame-Framework.xcconfig
// LAME
//
// Created by BB9z on 2021/9/8.
// Copyright © 2021, 2024 BB9z.
// https://github.com/BB9z/LAME-xcframework
//
// The MIT License
// https://opensource.org/licenses/MIT
//

CURRENT_PROJECT_VERSION = 3.100.1
CURRENT_PROJECT_VERSION = 3.100.2
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = $(CURRENT_PROJECT_VERSION);
FRAMEWORK_VERSION = A;
DYLIB_INSTALL_NAME_BASE = @rpath;
ENABLE_MODULE_VERIFIER = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = LAME_Prefix.pch;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Info.plist;
MACH_O_TYPE = staticlib;
LD_RUNPATH_SEARCH_PATHS = @executable_path/Frameworks @loader_path/Frameworks;
MACH_O_TYPE = mh_dylib;
PRODUCT_BUNDLE_IDENTIFIER = net.sourceforge.LAMEframework;
PRODUCT_MODULE_NAME = LAME;
PRODUCT_NAME = LAME;
Expand Down
14 changes: 14 additions & 0 deletions macosx/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
</dict>
</plist>
28 changes: 22 additions & 6 deletions macosx/make-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Build all platform targets and package them into the xcframework.
# Set `B9_BUILD_VISION_OS` environment variable to 0 can disable building for visionOS.
# Set `B9_BUILD_SYMBOLS` environment variable to 0 can disable including debug symbols in the xcframework.
#
# Copyright © 2021, 2024 BB9z.
# https://github.com/BB9z/LAME-xcframework
Expand All @@ -16,14 +17,14 @@ set -euo pipefail
# Return: 0 if variable is not empty or 0 or false
#
# Usage:
# if [[ $(check_var "$test_var") == 0 ]]; then
# if [[ $(checkVar "$test_var") == 0 ]]; then
# echo "Variable is not 0, false, or empty"
# else
# echo "Variable is 0, false, or empty"
# fi
checkVar() {
local var_value="$1"
if [[ -z "$var_value" || "$var_value" == "0" || "${var_value:l}" == "false" ]]; then
if [[ -z "$var_value" || "$var_value" == "0" || "${var_value}" == "false" ]]; then
echo "1"
else
echo "0"
Expand All @@ -38,9 +39,9 @@ function _xcbuild() {
echo "\nBuilding $scheme for $destination..." >&2

xcodebuild archive \
-scheme $scheme \
-destination $destination \
-archivePath $archivePath \
-scheme "$scheme" \
-destination "$destination" \
-archivePath "$archivePath" \
SKIP_INSTALL=NO
}

Expand All @@ -57,10 +58,14 @@ function xcbuild() {
echo "$PWD"

readonly B9_BUILD_VISION_OS=${B9_BUILD_VISION_OS:=1}
readonly B9_BUILD_SYMBOLS=${B9_BUILD_SYMBOLS:=1}

if [[ $(checkVar "$B9_BUILD_VISION_OS") != 0 ]]; then
echo "Skip building for visionOS."
fi
if [[ $(checkVar "$B9_BUILD_SYMBOLS") != 0 ]]; then
echo "Skip including debug symbols."
fi

## Clean

Expand All @@ -71,6 +76,11 @@ else
echo "No previous build, go on."
fi

if [ -d "build" ]; then
echo "Clean build directory."
rm -r "build"
fi

## Build

xcbuild LAME-macOS "generic/platform=macOS" "build/macOS"
Expand Down Expand Up @@ -103,10 +113,16 @@ if [[ $(checkVar "$B9_BUILD_VISION_OS") == 0 ]]; then
fi

packageCmds=("xcodebuild" "-create-xcframework")
for part in $archivePaths; do
for part in "${archivePaths[@]}"; do
packageCmds+=("-framework" "$part/Products/Library/Frameworks/LAME.framework")
if [[ $(checkVar "$B9_BUILD_SYMBOLS") == 0 ]]; then
# -debug-symbols requires full path
packageCmds+=(-debug-symbols "$PWD/$part/dSYMs/LAME.framework.dSYM")
fi
done
packageCmds+=("-output" "LAME.xcframework")

echo "${packageCmds[*]}"
"${packageCmds[@]}"

echo "✅ Make xcframework done."
24 changes: 23 additions & 1 deletion make-package.command
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@ sh ./make-xcframework.sh
cd "$ROOT_DIR"

mv "$ROOT_DIR/macosx/LAME.xcframework" "$ROOT_DIR"
zip -r -9 LAME.xcframework.zip LAME.xcframework LICENSE LICENSE-LAME

readonly countDSYMs=$(find "$ROOT_DIR/LAME.xcframework" -name "*.dSYM" | wc -l)
readonly hasDSYMs=$((countDSYMs > 0))
# echo "hasDSYMs: $hasDSYMs"

if [ $hasDSYMs = 1 ]; then
echo "\nPackaging with dSYMs..."
zip -r -9 LAME.xcframework_with_dsyms.zip LAME.xcframework LICENSE LICENSE-LAME COPYING

echo "\nRemove dSYMs for package again..."
find "$ROOT_DIR/LAME.xcframework" -name "dSYMs" -type d -exec rm -rfv {} +

echo "Remove DebugSymbolsPath in Info.plist."
local itemCount=$(/usr/libexec/PlistBuddy -c "Print :AvailableLibraries" "./LAME.xcframework/Info.plist" | grep -c "Dict")
for ((i=0; i<itemCount; i++)); do
/usr/libexec/PlistBuddy -c "Delete :AvailableLibraries:$i:DebugSymbolsPath" "./LAME.xcframework/Info.plist"
done
fi

echo "\nPackaging..."
zip -r -9 LAME.xcframework.zip LAME.xcframework LICENSE LICENSE-LAME COPYING

checksum=$(swift package compute-checksum LAME.xcframework.zip)
echo "Checksum: $checksum"

echo "✅ Successfully packaged LAME.xcframework at $ROOT_DIR/LAME.xcframework.zip"
1 change: 0 additions & 1 deletion make-xcframwork.command
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

set -euo pipefail
cd "$(dirname "$0")/macosx"
echo "$PWD"

if [ -x "$(command -v xcpretty)" ]; then
sh ./make-xcframework.sh | xcpretty
Expand Down

0 comments on commit d470bee

Please sign in to comment.