Commit graph

50 commits

Author SHA1 Message Date
Aleksei Voronov
b070df927c Bring back the proper requirement for base 2023-08-31 09:54:26 +02:00
John S Peterson
bb4bbfce0d Building in Ubuntu 2023-08-28 20:56:46 +02:00
Aleksei Voronov
f0c7030ddf I have tested and creating/extracting actually works 🎉
...at least from scratch. Next up: finding some actual test archives
2023-03-15 16:47:23 +01:00
Aleksei Voronov
d44ec77e3b Move the arc.groups example into an 'examples' directory 2023-03-15 16:37:01 +01:00
Aleksei Voronov
e20c9c1460 Use a 'safe' version of getting directory contents, one that ignores nonexistent directories 2023-03-15 16:32:38 +01:00
Aleksei Voronov
6cd3818fe6 Add necessary GHC options for RTS so that compression actually works
Also move them to the correct place
2023-03-15 16:32:07 +01:00
Aleksei Voronov
2e04fb68dc Remove everything related to 7zip.dll
This makes the whole thing compile _and_ run 🎉.

I have no idea what the ramifications of this are though. But it works?

Also this is like a very quick and dirty 'cleanup'. Things could probably be simplified further, but I'm lazy
2023-03-15 15:54:20 +01:00
Aleksei Voronov
5172ad16b0 Add a better README 2023-03-15 15:02:56 +01:00
Aleksei Voronov
8f2f33aa19 Add an extremely dirty and ugly way of linking things together
Literally just passing the .o files that 'compile' script generates directly to ld.

This is probably a very bad thing and I shouldn't do it this way, but it works for now and allows the linking to at least move on.

Now the next problem is that I have deleted a bunch of 7zip-related stuff that apparently is actually needed:

```
Undefined symbols for architecture x86_64:
  "_c_szArcClose", referenced from:
      _Ls1Frd_info in Arhive7zLib.o
  "_c_szArcGetBoolProperty", referenced from:
      _Lc1LuE_info in Arhive7zLib.o
      _Lc1MMq_info in Arhive7zLib.o
  "_c_szArcGetInt64Property", referenced from:
      _Lc1LpL_info in Arhive7zLib.o
      _Lc1Ltg_info in Arhive7zLib.o
      _Lc1MJs_info in Arhive7zLib.o
      _Lc1MKW_info in Arhive7zLib.o
      _Lc1N2b_info in Arhive7zLib.o
      _Lc1N6l_info in Arhive7zLib.o
      _Lc1N7W_info in Arhive7zLib.o
      ...
  "_c_szArcGetStrProperty", referenced from:
      _Ls1Fxz_info in Arhive7zLib.o
  "_c_szArcGetTimeProperty", referenced from:
      _Lc1Lrm_info in Arhive7zLib.o
  "_c_szArcItems", referenced from:
      _Lc1N3N_info in Arhive7zLib.o
  "_c_szCheckType", referenced from:
      _Lc1KNu_info in Arhive7zLib.o
  "_c_szCompress", referenced from:
      _Lc1NlY_info in Arhive7zLib.o
  "_c_szDefaultExtension", referenced from:
      _Ls1Fp5_info in Arhive7zLib.o
  "_c_szExtract", referenced from:
      _Lc1Nl4_info in Arhive7zLib.o
  "_c_szFindFormatForArchiveName", referenced from:
      _Ls1Fqd_info in Arhive7zLib.o
  "_c_szOpenArchive", referenced from:
      _Lc1KYd_info in Arhive7zLib.o
  "_c_szSetBreakFlag", referenced from:
      _Arhive7zzLib_setupBreakHandling3_info in Arhive7zLib.o
      _Lc1NxT_info in Arhive7zLib.o
      _Lc1NY7_info in Arhive7zLib.o
      _Lc1OlB_info in Arhive7zLib.o
```

This was pretty stupid of me, I guess. I'd like to get rid of 7zip support completely, but that's a bunch of work
so maybe next I'll try to just bring it back?
2023-03-15 14:49:14 +01:00
Aleksei Voronov
91a4e0a2b9 Remove a bunch of foreign call imports that do not exist and will never exist and are not necessary
These are for taskbar-related things, and we really do not need or want them, since I don't intend to support GUI stuff.
2023-03-15 12:23:01 +01:00
Aleksei Voronov
9659d89f1e Move C/CPP libraries into a 'clibs' subdirectory for cleanliness 2023-03-15 12:22:00 +01:00
Aleksei Voronov
0edad6e350 Remove 'documentation' which contains no documentation 2023-03-14 16:31:00 +01:00
Aleksei Voronov
25fe33721e Some quick fixes to make things finally compile
Hurray 🎉

These are shitty fixes however, because I've just commented out luaLevel stuff since I don't know wtf it is, and I'm pretty sure the exception handler that I have is also wrong, but let's leave things for now.

Next up: Linking
2023-03-14 16:25:07 +01:00
Aleksei Voronov
8ab01de159 More Haskell-fixing bits
- Add a `import GHC.Conc.Sync` statement because that module contains `setUncaughtExceptionHandler` apparently
- Repalce GHC.PArr with `vector` usage. I don't know if that's right, but it compiles so it must be?
- More explicit SomeException handlers. These will need to be fixed properly by using appropriate exception types, but later
- A bunch more `@`-without-whitespace fixes
2023-03-14 16:15:07 +01:00
Aleksei Voronov
8b217f4686 Import old version of Data.HashTable from base 4.6.0.0, and use it
Had to change some stuff in the original sources [^1] but it compiles now:
- Explicit `Control.Monad.mapM`
- `rec` is a keyword in modern Haskell, so I replaced the name with `rec_` where applicable. I think this is right. I don't know anything about Haskell after all.
2023-03-14 15:42:45 +01:00
Aleksei Voronov
0ea5c68bab More progress on having various Haskell modules compile with a modern toolchain
- A few places where `Utils.sortOn` needed to be qualified again
- `Data.HashTable` -> `Data.HashTable.IO`, but this doesn't actually work because the interface of the new library is wholly incompatible with the old one. No clue what to do about that yet.
- Some places where `@` can't have spaces around it, fixed
- A few places where `Control.Monad.mapM` needed to be qualified
- Remove `FREEARC_CELS` define, whatever the hell it means. It's not used anyway.
- Added `-iCompression/_TABI` to ghc args so that it can find that weird TABI module. Long term I should probably get rid of that nonsense.

What I don't know how to deal with:

- `GHC.PArr` isn't a thing anymore
- New hashtables library does not allow one to specify custom eq/hash functions. Maybe I can copy and paste the old one somewhere.
2023-03-14 15:30:08 +01:00
Aleksei Voronov
1da9c1425e Make ArhiveStructure, UIBase and UI compile
- Mostly `@` patterns that may not have spaces around them
- One case of a missing import of `unsafePerformIO`

🎉
2023-03-08 17:03:05 +01:00
Aleksei Voronov
3da0d35a42 Move EncryptionLib.hs where it belongs 2023-03-08 17:00:14 +01:00
Aleksei Voronov
db37dfa8d8 Fix a bunch more files, the journey continues
- Apparently you can't have a space after `@` in the way that it's used. The compiler told me so.
- `Data.HashTable` isn't a thing anymore, but we can use `Data.HashTable.IO` from `hashtables`, which is now a dependency. Some old docs with deprecation messages told me to do this.
- More explicit error types
- `mapM_` is a thing in `Control.Monad`, apparently. No idea what it is, but it compiles.
- `sortOn` is a custom thing in `Utils`, so be explicit.

`FileInfo.hs` and `Options.hs` compile now 🎉
(and I think `Compression.hs` too)
2023-03-08 16:55:29 +01:00
Aleksei Voronov
ff0208037c Fix a bunch of problems when compiling Errors.hs
Just a bunch of other error type specifications. Nothing particularly interesting.

Now it compiles 🎉
2023-03-08 16:29:14 +01:00
Aleksei Voronov
76c9148d32 Compile a bunch more haskell modules
- ByteStream has NOINLINE specified for what seem to be Haskell's abstract methods, which is apparently not allowed. I don't think it's a big deal, so I've commented them out for now.
- A bunch more explicit SomeException types were required in error handling logic in Charsets.hs
- My earlier copy-and-pasted implementation of ignoreErrors wasn't working, so here's a better one that actually works with code that uses it
2023-03-08 16:20:28 +01:00
Aleksei Voronov
852e13b882 Fix type errors in exception handling
Apparently modern GHC requires specific exception types everywhere.
From what I can tell the intention of all this code was to catch any exception,
so SomeException it is.

This makes Files.hs compile 🎉
2023-03-08 15:59:21 +01:00
Aleksei Voronov
81f700ae30 Attempt to build all the Haskell stuff with Cabal on a modern GHC
This is mostly about two things:

1. Setting up `cabal`

   I basically just set up a new project, moved a bunch of files around and
   configured extensions and some libraries that are clearly required.

   The original script used `-fglasgow-exts` so I copy and pasted the
   extensions this enables from Haskell docs [^1]. Also enabled
   `UndecidableInstances`, `OverlappingInstances`, `NoMonomorphismRestriction`
   and `BangPatterns` as per the original command line too. And also added
   `RecordWildCards` because they were enabled in some modules explicitly.

   The basics seem to work.

   I had to add dependencies on `old-time` and `old-locale` because there's
   a bunch of code relying on those things, and I don't know enough yet to
   be capable of modernizing these to use newer supported libraries. I hope
   it will work later.

2. Getting `Utils.hs` to compile

   This was a bit trickier, but works ultimately:

   - I removed all of the byte order stuff because it's not necessary anymore
   - Replaced `Data.HashTable.hashString` with `Data.Hashable.hash` because
     that's how it's done in modern Haskell apparently
   - `sortOn` needed to be qualified for reasons
   - Added an explicit type annotation to `handleErrors`, because apparently
     modern exceptions require them.
   - Replaced `ignoreErrors` implementation with one that I found on the
     internet, but I'm not sure it's correct. We'll see later?

[^1]: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html#ghc-flag--fglasgow-exts
2023-03-07 09:39:21 +01:00
Aleksei Voronov
e18034cb3f Get rid of a bunch more defines that I'm not interested in
- FREEARC_INTEL_BYTE_ORDER and FREEARC_MOTOROLA_BYTE_ORDER: keep only intel byte order support, don't care about the rest
2023-03-07 09:23:30 +01:00
Aleksei Voronov
62aaaa254c Get rid of the special stuff for multiple common.mak files
We don't have multiple platforms with different requirements anymore, so give up
2023-02-01 19:56:00 +01:00
Aleksei Voronov
e6f6779e40 Remove unnecessary myOnException in favor of the built-in one
This version doesn't work anyway
2023-01-14 12:26:07 +01:00
Aleksei Voronov
2b44c33bde Fix a bunch of empty do block errors
Hopefully correctly. Or maybe not. I have no idea what I'm doing.
2023-01-11 15:55:02 +01:00
Aleksei Voronov
12a25b30f0 threadsafe foreign call annotation was removed in GHC 7.2.1, and 'safe' should be used instead 2023-01-11 15:46:37 +01:00
Aleksei Voronov
04c7bfd5cb Attempt to fix some Haskell compilation errors
Replace OldException with Exception
Replace IOBase with IO

This doesn't fix everything, but it's a start
2023-01-11 15:40:23 +01:00
Aleksei Voronov
299e734065 Remove Client7z as well
Looks like some windows thing too, not interested
2023-01-11 14:38:13 +01:00
Aleksei Voronov
6af4ec7e56 Add back an accidentally removed endif 2023-01-11 14:37:47 +01:00
Aleksei Voronov
9684e7ca60 Remove FAZip example since it is a Windows app that I don't care about 2023-01-11 14:16:42 +01:00
Aleksei Voronov
3b3e701de3 Remove unsupported linker arguments
No clue what they are, don't care
2023-01-11 14:15:35 +01:00
Aleksei Voronov
0a5a1f8c5f Remove CLS since it doesn't and will never work on non-Windows 2023-01-11 14:15:00 +01:00
Aleksei Voronov
d50e099477 Remove an optimization option that's not supported by clang at all 2023-01-11 13:26:36 +01:00
Aleksei Voronov
f09b983752 Ignore more compilation artifacts 2023-01-11 13:26:08 +01:00
Aleksei Voronov
41c60cc85c Undo sorting of imports in tomcrypt.h
Apparently this order has meaning. Sigh.
2023-01-11 12:40:14 +01:00
Aleksei Voronov
27db5f84aa malloc.h doesn't exist on macs, but all the stuff it has is in stdlib.h apparently 2023-01-11 11:57:36 +01:00
Aleksei Voronov
1db6800b0d Disambiguate CPP generics from bitshifts to make things compile
Apparently you can use arbitrary expressions in generics in C++, which includes bitshifts. So the compiler gets confused when you have lots of >>> present in your code and you need to put spaces around them to make things work
2023-01-11 11:42:41 +01:00
Aleksei Voronov
022186913e Ignore some artifacts that are produced during build
Let's not pollute our repo, shall we
2023-01-11 11:41:38 +01:00
Aleksei Voronov
c119d10c78 defaultUserHooks is deprecated, and it looks like autoconfUserHooks is what should be used
Or not. I have no idea what I'm doing
2023-01-11 11:40:35 +01:00
Aleksei Voronov
1e9fc56e33 Remove --cc=ghc when building TABI
I do not know what TABI is, but ghc is most definitely not cc and it doesn't work this way; removing this seems to be okay, so let's do that for now
2023-01-11 11:40:06 +01:00
Aleksei Voronov
0c2e18b4de _SC_AVPHYS_PAGES is not available on macs
GetAvailablePhysicalMemory doesn't seem to be used anywhere anyway, so let's get rid of it completely and save ourselves the trouble
2023-01-11 11:39:15 +01:00
Aleksei Voronov
908ad6c826 RUSAGE_THREAD is Linux-specific and isn't available on Macs
Steal a Mac-compatible implementation from the internet
2023-01-11 11:38:05 +01:00
Aleksei Voronov
d5c52bae53 Reformat all of CPP code with clang-format 2023-01-11 10:08:59 +01:00
Aleksei Voronov
edd8d6e0c9 Remove everything that has to do with FREEARC_DLL 2023-01-11 10:03:48 +01:00
Aleksei Voronov
4c0b7d666b Remove one more bit of code that's related to Windows 2023-01-10 13:33:14 +01:00
Aleksei Voronov
17d3b2b1a4 Convert the lot of the text files from cp1251 to utf8
2023 baby, yeah.
2023-01-10 13:27:20 +01:00
Aleksei Voronov
5bd67eebc4 Delete everything that I absolutely do not intend to even try to run
These are:
- GUIs
- Shell extensions
- FAR plugin (lol)
- Everything that has to do with supporting Windows
- Installers et al.
- Lua support

Things still don't compile though, at least not with a modern toolchain, but the problems seem
smaller than if I had tried to do the lot.
2023-01-10 12:48:09 +01:00
Aleksei Voronov
76d1e4fc4c Import original 0.67 freearc sources 2023-01-10 10:50:12 +01:00