├── README.md ├── LICENSE └── azure-pipelines.yml /README.md: -------------------------------------------------------------------------------- 1 | # HackinPlugins -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 bugprogrammer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Starter pipeline 2 | # Start with a minimal pipeline that you can customize to build and deploy your code. 3 | # Add steps that build, run tests, deploy, and more: 4 | # https://aka.ms/yaml 5 | 6 | trigger: none 7 | pr: none 8 | 9 | schedules: 10 | - cron: "0 0 * * *" # DAMN BUG!!!!!!!!!!!!!!!!!!!!!!!!! 11 | displayName: Schedule Build 12 | branches: 13 | include: 14 | - master 15 | always: true 16 | 17 | pool: 18 | vmImage: 'macOS-latest' 19 | 20 | steps: 21 | - task: Bash@3 22 | displayName: initCheck 23 | inputs: 24 | targetType: 'inline' 25 | script: | 26 | #!/bin/bash 27 | # nasm 28 | pushd /tmp >/dev/null || exit 1 29 | rm -rf nasm-mac64.zip 30 | curl -OL "https://github.com/acidanthera/ocbuild/raw/master/external/nasm-mac64.zip" || exit 1 31 | nasmzip=$(cat nasm-mac64.zip) 32 | rm -rf nasm-* 33 | curl -OL "https://github.com/acidanthera/ocbuild/raw/master/external/${nasmzip}" || exit 1 34 | unzip -q "${nasmzip}" nasm*/nasm nasm*/ndisasm || exit 1 35 | sudo mkdir -p /usr/local/bin || exit 1 36 | sudo mv nasm*/nasm /usr/local/bin/ || exit 1 37 | sudo mv nasm*/ndisasm /usr/local/bin/ || exit 1 38 | rm -rf "${nasmzip}" nasm-* 39 | popd >/dev/null || exit 1 40 | 41 | # iasl 42 | pushd /tmp >/dev/null || exit 1 43 | rm -rf iasl-macosx.zip 44 | curl -OL "https://github.com/acidanthera/ocbuild/raw/master/external/iasl-macosx.zip" || exit 1 45 | iaslzip=$(cat iasl-macosx.zip) 46 | rm -rf iasl 47 | curl -OL "https://github.com/acidanthera/ocbuild/raw/master/external/${iaslzip}" || exit 1 48 | unzip -q "${iaslzip}" iasl || exit 1 49 | sudo mkdir -p /usr/local/bin || exit 1 50 | sudo mv iasl /usr/local/bin/ || exit 1 51 | rm -rf "${iaslzip}" iasl 52 | popd >/dev/null || exit 1 53 | 54 | # mtoc 55 | pushd /tmp >/dev/null || exit 1 56 | rm -f mtoc mtoc-mac64.zip 57 | curl -OL "https://github.com/acidanthera/ocbuild/raw/master/external/mtoc-mac64.zip" || exit 1 58 | mtoczip=$(cat mtoc-mac64.zip) 59 | rm -rf mtoc-* 60 | curl -OL "https://github.com/acidanthera/ocbuild/raw/master/external/${mtoczip}" || exit 1 61 | unzip -q "${mtoczip}" mtoc || exit 1 62 | sudo mkdir -p /usr/local/bin || exit 1 63 | sudo rm -f /usr/local/bin/mtoc /usr/local/bin/mtoc.NEW || exit 1 64 | sudo cp mtoc /usr/local/bin/mtoc || exit 1 65 | popd >/dev/null || exit 1 66 | - task: Bash@3 67 | displayName: Build OpenCorePkg 68 | inputs: 69 | targetType: 'inline' 70 | script: | 71 | #!/bin/bash 72 | BD="$(date +"%Y-%m-%d")" # Build Date 73 | echo "##vso[task.setvariable variable=BuildDate]$BD" 74 | cd ../b 75 | git clone --depth=30 https://github.com/acidanthera/OpenCorePkg.git 76 | cd OpenCorePkg 77 | ./build_oc.tool 78 | cp -f Binaries/* ../ 79 | cd ../ 80 | rm -rf OpenCorePkg 81 | git clone https://github.com/acidanthera/MacKernelSDK >/dev/null || exit 1 82 | git clone https://github.com/acidanthera/Lilu.git 83 | cd Lilu 84 | cp -Rf ../MacKernelSDK . 85 | xcodebuild -configuration Debug -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 86 | xcodebuild -configuration Release -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 87 | unzip build/Debug/*.zip 88 | cp -Rf build/Debug/*.kext ../Lilu.kext 89 | cp -f build/Debug/*.zip ../ 90 | cp -f build/Release/*.zip ../ 91 | cd ../ 92 | rm -rf Lilu 93 | git clone -q https://github.com/acidanthera/VoodooInput.git -b master --depth=1 94 | cd VoodooInput 95 | cp -Rf ../MacKernelSDK . || exit 1 96 | xcodebuild -configuration Release -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 97 | xcodebuild -configuration Debug -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 98 | mkdir -p ../VoodooInputRelease && cp -Rf build/Release ../VoodooInputRelease && cp -Rf build/Debug ../VoodooInputRelease 99 | cd ../ 100 | rm -rf VoodooInput 101 | mv VoodooInputRelease VoodooInput 102 | 103 | hackinLiluPlugins=('AirportBrcmFixup,https://github.com/acidanthera/AirportBrcmFixup.git' 104 | 'AppleALC,https://github.com/acidanthera/AppleALC.git' 105 | 'ATH9KFixup,https://github.com/chunnann/ATH9KFixup.git' 106 | 'CPUFriend,https://github.com/acidanthera/CPUFriend.git' 107 | 'CpuTscSync,https://github.com/lvs1974/CpuTscSync.git' 108 | 'DebugEnhancer,https://github.com/acidanthera/DebugEnhancer.git' 109 | 'HibernationFixup,https://github.com/acidanthera/HibernationFixup.git' 110 | 'NVMeFix,https://github.com/acidanthera/NVMeFix.git' 111 | 'RTCMemoryFixup,https://github.com/acidanthera/RTCMemoryFixup.git' 112 | 'VirtualSMC,https://github.com/acidanthera/VirtualSMC.git' 113 | 'WhateverGreen,https://github.com/acidanthera/WhateverGreen.git' 114 | 'RestrictEvents,https://github.com/acidanthera/RestrictEvents.git') 115 | 116 | hackinPlugins=('IntelMausi,https://github.com/acidanthera/IntelMausi.git' 117 | 'AtherosE2200Ethernet,https://github.com/Mieze/AtherosE2200Ethernet.git' 118 | 'RTL8111_driver_for_OS_X,https://github.com/Mieze/RTL8111_driver_for_OS_X.git' 119 | 'LucyRTL8125Ethernet,https://github.com/Mieze/LucyRTL8125Ethernet.git') 120 | 121 | voodooinputPlugins=('VoodooPS2,https://github.com/acidanthera/VoodooPS2.git' 122 | 'VoodooI2C,https://github.com/VoodooI2C/VoodooI2C.git') 123 | 124 | for plugin in ${hackinLiluPlugins[*]}; do 125 | git clone -q ${plugin##*,} ${plugin%,*} -b master --depth=1 126 | cd ${plugin%,*} 127 | if [ ! -e Lilu.kext ]; then 128 | cp -Rf ../Lilu.kext . 129 | cp -Rf ../MacKernelSDK . 130 | fi 131 | xcodebuild -configuration Release -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 132 | xcodebuild -configuration Debug -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 133 | if [ -e build/Release/*.zip ]; then 134 | cp -f build/Release/*.zip ../ 135 | cp -f build/Debug/*.zip ../ 136 | else 137 | cp -Rf build/Release/*.kext ../ 138 | cp -Rf build/Debug/*.kext ../ 139 | fi 140 | cd ../ 141 | rm -rf ${plugin%,*} 142 | done; 143 | 144 | for plugin in ${hackinPlugins[*]}; do 145 | git clone -q ${plugin##*,} ${plugin%,*} -b master --depth=1 146 | cd ${plugin%,*} 147 | cp -Rf ../MacKernelSDK . 148 | xcodebuild -configuration Release -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 149 | xcodebuild -configuration Debug -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 150 | if [ -e build/Release/*.zip ]; then 151 | cp -f build/Release/*.zip ../ 152 | cp -f build/Debug/*.zip ../ 153 | else 154 | cp -Rf build/Release/*.kext ../ 155 | cp -Rf build/Debug/*.kext ../ 156 | fi 157 | cd ../ 158 | rm -rf ${plugin%,*} 159 | done; 160 | 161 | for plugin in ${voodooinputPlugins[*]}; do 162 | git clone -q ${plugin##*,} ${plugin%,*} -b master --depth=1 163 | cd ${plugin%,*} 164 | cp -Rf ../MacKernelSDK . 165 | if [[ "VoodooI2C" =~ ${plugin%,*} ]]; then 166 | cp -Rf ../VoodooInput ./Dependencies/ 167 | git submodule init && git submodule update 168 | echo "VoodooI2C: 从 Build Phrase 中移除 Linting 和 Generate Documentation 来避免安装 cpplint 和 cldoc" 169 | lintingPhr=$(grep -n "Linting" VoodooI2C/VoodooI2C.xcodeproj/project.pbxproj) && lintingPhr=${lintingPhr%%:*} 170 | /usr/bin/sed -i '' "${lintingPhr}d" VoodooI2C/VoodooI2C.xcodeproj/project.pbxproj 171 | gDPhr=$(grep -n "Generate Documentation" VoodooI2C/VoodooI2C.xcodeproj/project.pbxproj) && gDPhr=${gDPhr%%:*} 172 | /usr/bin/sed -i '' "${gDPhr}d" VoodooI2C/VoodooI2C.xcodeproj/project.pbxproj 173 | xcodebuild -scheme VoodooI2C -configuration Release -derivedDataPath . -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO || exit 1 174 | xcodebuild -scheme VoodooI2C -configuration Debug -derivedDataPath . -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO || exit 1 175 | else 176 | cp -Rf ../VoodooInput . 177 | xcodebuild -configuration Release -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 178 | xcodebuild -configuration Debug -arch x86_64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO 179 | fi 180 | 181 | if [ -e build/Products/Release/*.zip ]; then 182 | cp -f build/Products/Release/*.zip ../ 183 | cp -f build/Products/Debug/*.zip ../ 184 | else 185 | cp -Rf Build/Products/Release/*.kext ../ 186 | cp -Rf Build/Products/Debug/*.kext ../ 187 | fi 188 | cd ../ 189 | rm -rf ${plugin%,*} 190 | done; 191 | 192 | rm -rf Lilu.kext 193 | rm -rf VoodooInput 194 | rm -rf MacKernelSDK 195 | name=HackinPlugins_`date +%Y%m%d`.zip 196 | zip -q -r $name * 197 | ls 198 | mkdir ../a/Artifacts 199 | cp -f $name ../a/Artifacts 200 | ls $(Build.ArtifactStagingDirectory)/Artifacts 201 | 202 | 203 | - task: GitHubRelease@1 204 | inputs: 205 | gitHubConnection: 'github' 206 | repositoryName: '$(Build.Repository.Name)' 207 | action: 'create' 208 | target: '$(Build.SourceVersion)' 209 | tagSource: 'userSpecifiedTag' 210 | tag: '$(BuildDate)' 211 | title: '$(BuildDate)' 212 | releaseNotesSource: 'inline' 213 | releaseNotesInline: 'Hackintosh全家桶每日编译更新' 214 | assets: '$(Build.ArtifactStagingDirectory)/Artifacts/*.zip' 215 | isPreRelease: false 216 | addChangeLog: false 217 | 218 | 219 | --------------------------------------------------------------------------------