sidneys / homebrew-homebrew

sidneys.github.io Homebrew Tap
23 stars 13 forks source link

Mac M1 chntpw not building (Openssl 1.0 requirement not satisfied) #2

Open ameeno opened 3 years ago

ameeno commented 3 years ago

Hello.

I have a mac M1 mba and I am trying to install sidneys/homebrew/chntpw

i have tried via rosetta and also via regular arm homebrew. unfortunately there is an issue building openssl 1.0 for this cpu,

there seems to be some instructions to build it manually on openssl github repo, any chance this can be incorporated into your script?

Drovosek01 commented 11 months ago

I tri install sidneys/homebrew/chntpw for use UUPDump script on my macOS. I test it on hackintosh (of couse Intel processor) with macOS Monterey 12.6.8.

I execute in terminal brew install sidneys/homebrew/chntpw but after ~5-7 minutes it crash on testes:

% brew install sidneys/homebrew/chntpw
==> Fetching dependencies for sidneys/homebrew/chntpw: sidneys/homebrew/openssl@1.0
==> Fetching sidneys/homebrew/openssl@1.0
==> Downloading https://gist.githubusercontent.com/felixbuenemann/5f4dcb30ebb3b86e1302e2ec305bac89/raw/b339a33ff072c9747df21e2558c36634dd62c195/openssl-1.0.2u-darwin-arm64.patch
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/db281f2b8a51c8a97d6bced562e99959b2c8b3241129895f8850506ccd1f8899--openssl-1.0.2u-darwin-arm64.patch
==> Downloading https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/6a06bfa556bd474c7e4efb2eab11c7d43d4238b508bd91e74c438653e24b8a45--openssl-1.0.2u.tar.gz
==> Fetching sidneys/homebrew/chntpw
==> Downloading https://github.com/sidneys/chntpw/archive/0.99.6.tar.gz
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/dee692592b6fc0d6db43012210cf70e9ef7a6018e20818b5f15187cbd3a06e39--chntpw-0.99.6.tar.gz
==> Installing chntpw from sidneys/homebrew
==> Installing dependencies for sidneys/homebrew/chntpw: sidneys/homebrew/openssl@1.0
==> Installing sidneys/homebrew/chntpw dependency: sidneys/homebrew/openssl@1.0
==> Patching
==> Applying openssl-1.0.2u-darwin-arm64.patch
patching file Configure
==> perl ./Configure --prefix=/usr/local/Cellar/openssl@1.0/1.0.2u_1 --openssldir=/usr/local/etc/openssl@1.0 no-ssl2 no-ssl3 no-zlib shared enable-cms darwin64-x86_64-cc enable-ec_nist
==> make
==> make test
Last 15 lines from /Users/user/Library/Logs/Homebrew/openssl@1.0/03.make:
g = 2
Salt = 77AD42C3AD1C52E22BA5B955ACB20925A951F64B
Verifier = 4731801457956035ABE95D4CD73EF79AE97BC0453633A09350B3285128329BFA2A2489ABA89EB768A9FECE0467020978EE6F468FD98173F6497D662ABF793F734E0F63ECC4DA3C9F14EE52973D8ADB6CC5895688DE49348BB0957AEE9C159CA36C2579080F7EFE2B82E3317E650D447BCB0831CB154863A39889CD90A1B06740
b = 2508C70A803705B0C866382BE09241465837DB0DDDB3BB53695DEA74D186930E
B = C0578B34AC2794861E51A4F1877E17240ABDEACFDC0B2E464AF6FCE13FCDA4ADF44BB8EA9E7325F1E21488D4AA369CB958AA9D678DD270AD6DBB553F6E6B61B81D1D31B706382374F3BF962484B9296F241BAFA14EBBC82850404E813C043330685D93269A2CE9BA7D6D83833BF14475728A796503C705769B25CC89CCC662BE
a = 49331204691F060CBF715C0B01927C3BA646AE45EBA03442BA300832C81DB79
A = 1EB0172EB4AC1621C18946ED6D9A8210F2EEE3E248B2A0D8389D649551BF3041C35DEC4B6F30941B82153AA33C2E96B6258D74A6F7DB5E2387BC02B70336CCF284967FFBF671362C601FCD3CBE46154D022037E8A22EB17EAD455DE90DE713A848272A715ED857D80FB0FA07EDE7ED096A41F4D2A5D7DA37AFC2B787F66C6D55
Client's key = E992E408A1954BC7FECF1AB0B079E80C9418215F418D74E2510631ED9A3FDCF6DB8041545F3D1EEE58D053A8DDE6D9D6EB85F98F2EB1D92A8F7B549B963350262EB081CBE4215FEF5A7035340B2F2098A12CAFA2B7D4DF76ED726374952A2E2E26847DA985B0A2D580AB176B615BCF0E5F04C8D8A120CD7FF941C90E922B8D82
Server's key = E992E408A1954BC7FECF1AB0B079E80C9418215F418D74E2510631ED9A3FDCF6DB8041545F3D1EEE58D053A8DDE6D9D6EB85F98F2EB1D92A8F7B549B963350262EB081CBE4215FEF5A7035340B2F2098A12CAFA2B7D4DF76ED726374952A2E2E26847DA985B0A2D580AB176B615BCF0E5F04C8D8A120CD7FF941C90E922B8D82
CMS consistency test
/usr/bin/perl cms-test.pl
CMS => PKCS#7 compatibility tests
signed content DER format, RSA key: verify error
make[1]: *** [test_cms] Error 1
make: *** [tests] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/sidneys/homebrew-homebrew/issues

These open issues may also help:
Mac M1 chntpw not building (Openssl 1.0 requirement not satisfied) https://github.com/sidneys/homebrew-homebrew/issues/2

Screenshot 2023-10-08 at 00 40 00

Anybody know how fix it?

UPDATE: Installing alternatives

brew tap minacle/chntpw
brew install minacle/chntpw/chntpw

from comment - https://github.com/sidneys/homebrew-homebrew/issues/2#issuecomment-885728072 fixed problem.

Why UUPDump readme file recommend use this repository instead repositoy by @minacle ? :/

adrianbourke commented 7 months ago

I have the same issue. Anyone got it fixed?

To get it fixed, use @itsmattkc's PR, then download chntpw from sidney's cask, here: https://github.com/sidneys/chntpw/archive/0.99.6.tar.gz Untar the downloaded file, edit the Makefile replace the line that contains OSSLPATH by this one:

OSSLPATH=/opt/homebrew/Cellar/openssl@1.0/1.0.2u

Save the Makefile, go to the terminal, navigate to the folder where chntpw is located, execute make and, finally, cp chntpw /opt/hombrew/bin and you're good to go

Made a patch for it. https://gist.github.com/minacle/87d11243b135b2041c945f1287d33d7e

Easy Installation

curl -LO https://gist.github.com/minacle/e9dedb8c17025a23a453f8f30eced3da/raw/908b944b3fe2e9f348fbe8b8800daebd87b5966c/openssl@1.0.rb
curl -LO https://gist.github.com/minacle/e9dedb8c17025a23a453f8f30eced3da/raw/908b944b3fe2e9f348fbe8b8800daebd87b5966c/chntpw.rb
brew install --formula --build-from-source ./openssl@1.0.rb
brew install --formula --build-from-source ./chntpw.rb
rm ./openssl@1.0.rb ./chntpw.rb

Thanks, @minacle! It worked for me

Anyone had issues with this?

brew install --formula --build-from-source ./openssl@1.0.rb

==> Fetching openssl@1.0
==> Downloading https://gist.githubusercontent.com/felixbuenemann/5f4dcb30ebb3b86e1302e2ec305bac89/raw/b339a33ff072c9747df21e2558c36634dd62c195/openssl-1.0.2u-darwin-arm64.patch
Already downloaded: /Users/adrian/Library/Caches/Homebrew/downloads/db281f2b8a51c8a97d6bced562e99959b2c8b3241129895f8850506ccd1f8899--openssl-1.0.2u-darwin-arm64.patch
==> Downloading https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz
Already downloaded: /Users/adrian/Library/Caches/Homebrew/downloads/6a06bfa556bd474c7e4efb2eab11c7d43d4238b508bd91e74c438653e24b8a45--openssl-1.0.2u.tar.gz
==> Patching
==> Applying openssl-1.0.2u-darwin-arm64.patch
patching file Configure
==> perl ./Configure --prefix=/opt/homebrew/Cellar/openssl@1.0/1.0.2u --openssldir=/opt/homebrew/etc/openssl@1.0 no-ssl2 no-ssl3 no-zlib shared enable-cms darwin64-arm64-cc enabl
==> make
Last 15 lines from /Users/adrian/Library/Logs/Homebrew/openssl@1.0/02.make:
2024-02-01 17:54:41 +0000

make

making all in crypto...
/usr/bin/perl ../util/mkbuildinf.pl "clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch arm64 -O3 -DL_ENDIAN -Wall" "darwin64-arm64-cc" >buildinf.h
clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch arm64 -O3 -DL_ENDIAN -Wall   -c -o cryptlib.o cryptlib.c
/opt/homebrew/Library/Homebrew/shims/mac/super/clang: line 9: /opt/homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby: Argument list too long
/opt/homebrew/Library/Homebrew/shims/mac/super/clang: line 9: /opt/homebrew/Library/Homebrew/vendor/portable-ruby/current/bin/ruby: Undefined error: 0
make[1]: *** [cryptlib.o] Error 1
make: *** [build_crypto] Error 1

Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!