Guest User

Untitled

a guest
Nov 14th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ######################################
  4. # requires alsa-lib-1.0.25.tar.bz2 #
  5. ######################################
  6.  
  7. python3 <<EOF
  8. #!/usr/bin/env python3
  9.  
  10. import sys
  11. sys.dont_write_bytecode = True
  12. import os
  13. import subprocess
  14.  
  15.  
  16. def main():
  17.  
  18. opsys = shell("uname -s").lower()
  19. if opsys == "darwin": os._exit(0) # MacOS, no problem
  20.  
  21. whereis = shell("whereis libasound").lower()
  22. items = whereis.split(" ")
  23. for item in items:
  24. if not "." in item: continue
  25. extension = item.split(".")[1]
  26. if extension == "a": os._exit(0) # libasound.a found
  27.  
  28. os._exit(1)
  29.  
  30.  
  31. def shell(command):
  32.  
  33. return subprocess.run(
  34. command.split(" ")
  35. ,stdout=subprocess.PIPE
  36. ).stdout.decode("utf-8").strip()
  37.  
  38.  
  39. main()
  40.  
  41. EOF
  42.  
  43. if [ $? -eq 0 ]; then
  44. exit
  45. fi
  46.  
  47.  
  48. DIR=$(dirname "${BASH_SOURCE[0]}")
  49. DIR=$(realpath "${DIR}")
  50. cd $DIR
  51.  
  52. rm -rf cd alsa-lib-1.0.25
  53. tar xvf alsa-lib-1.0.25.tar.bz2
  54. cd alsa-lib-1.0.25
  55.  
  56. ./configure --disable-shared --enable-static
  57. make -j4
  58. echo password required for sudo make install
  59. sudo make install
Add Comment
Please, Sign In to add comment